"Confined" gives the sense of imprisonment. It can be used to say that someone is unable to get out of a situation, and even though a person may need to be in the hospital, it doesn't fit the general feel of "confined."
A hospital is a place that people (usually) go voluntarily. Unless there is the case of mental illness, a hospital cannot make a person stay there, so they do not confine people.
However, as Gary mentioned people can be confined to bed or wheelchair. And if you do use "confined to the hospital" it will give the sense that the person wants to get out, but is not able to because of health or mental health problems.