I may even argue that hospitals should be built before factories, but that point of view may be a bit more controversial.
In fact, this is a very interesting point, about which I still haven't come to a "final" conclusion, even after 21 years of Civ3...
If you just look at the numbers, a Hospital pays off big time: less maintenance (for buildings as well as units), more income/production from the city center, less corruption, and in many places you can finally get the commerce from all the coastal tiles you couldn't work before with size-12 cities.
However, there are more sides to the story: namely what is your desired victory condition? There are basically three types:
military victory (Conquest, Domination, 100K),
science victory (Space and UN) and
cultural victory (20K). (Note here that 100K is basically a military victory condition, not a cultural victory...!

)
If you are playing for a military victory, there is no need to go past Military Tradition, so these games will be over long before it is even possible to get Hospitals. So Hospitals are not a factor for these.
For a science victory, it basically boils down to the question, "can the time spent for the optional tech Sanitation be made up again by the benefit the Hospitals provide"? If you can achieve 4-turn research without Hospitals, then the 4 turns wasted on Sanitation can never be recovered, so it is obviously bad to go for Hospitals. This more or less covers all games at lower difficulty levels, where it shouldn't be a problem to have 4-turn research some time in the middle of the middle ages (after Universities). So that leaves the higher difficulty levels. And for these I often found a useful "compromise": I research the non-optional techs (so I don't lose time on the way to the required techs like Fission for the UN or the techs for the spaceship parts), while a powerful AI usually comes up with Sanitation "early enough". Then I trade for it and build Hospitals in those coastal cities that can work 3-5 additional tiles for a much higher commerce output. So the answer is: "Hospitals yes, but let the AI do the work for you"... (I follow a similar approach for Communism/Police Stations, which are also very important in those cases where you struggle to maintain 4-turn research. The AI usually goes for Communism quite early, and that's good enough for me...)
That leaves the special case of a 20K victory. Here it is not necessary to get a number of required techs as fast as possible. Instead you only have to make sure to get the tech for the next cultural building on time. But if the 20K city is currently building a wonder for 20-30 turns, you may afford to go for an optional tech that is not strictly required for the next cultural building. And still have the tech for the next wonder ready in time. But do you need Hospitals in this case? The 20K city should have Shakespeare's Theater, so it won't need a Hospital. And the remaining cities (which mainly provide the required research) don't need them that urgently. So on the higher difficulty levels, you can leave the job to the AI again, and on the lower difficulty you can do Sanitation at a convenient time, when there is nothing more important to do...