In the end she ended up having to be hospitalized.

Literal

She [topic-は] in-the-end [topicalized-には] hospitalized-do predicament became.

Two pieces fall into place: しまいには ('in the end, finally') frames the outcome as the culmination of a process, and ~はめになる (often written ~羽目になる with kanji) tags the outcome as unwanted — 'getting saddled with' a situation. The expression literally means 'become a predicament,' and it's reserved for outcomes the subject didn't want or didn't choose. 入院する covers being admitted to hospital, distinct from 通院する (going to a hospital as an outpatient). Together, the sentence paints a familiar narrative arc: things piled up, got worse, and finally she had no choice but to be hospitalized.