Yeah like I said mostly haha. ^^ Same with el problema, etc. There's probably a nice ethymological explanation to memorize them better but in the end you have to deal with irregularities in any language except maybe Esperanto or some other artificial ones.
I’m sure there’s etymological reasons, but in practice ‘la hospital’ being less pleasant to say (with two vowel sounds directly next to each other) probably contributed. Like how it’s el agua, even though any adjectives for it are feminine: el agua contaminada.