"I hate going to the hospital."
の in this sentence is what's called a nominalizer. It turns essentially turns the first part of the sentence, びょういんに行く, into a noun so you can use the は...です form on it. Think of it as a way of saying "the act of [preceding phrase]."
A more literal translation might be: "The act of going to the hospital is unlikable [to me]."
は, in this case, is the topic particle. It makes it clear that the act of going to the hospital is the main idea, not the person itself. It replaces the が particle, as is standard with all particles except に, と, and で. In those cases, you append は after the particle instead of replacing it.
It depends on what the thing you're nominalizing is doing in the sentence. I think it's usually は or が, but it can also be を. (Example: 授業に行くのを忘れました = (I) forgot to go to class.)
I'm not sure about のに or ので being used in this way, since they are also used as particles between clauses (のに = although/despite [the clause before it]; ので = because [the clause before it]). The WWWJDIC does link to some examples that suggest that のに, at least, can be used in this way as well.