It's late here, nearly midnight, so I'll keep this somewhat brief but feel free to ask follow ups if you have them and I can answer those tomorrow.
The issue with language policy in Taiwan is a bit complicated. What you had was, under Japanese rule, a brutal but gradual prohibition of speaking non-Japanese languages, which lasted until the KMT took over in 1945. I say gradual because they actually did it in a pretty effective way compared to the KMT who, under Chen Yi, botched it bad.
Under Japanese rule, there were basically three phases, each more restrictive than the previous one. Initially children could still use Hokkien and Hakka, and even learn them in school, but by the end of the Japanese occupation really only Japanese was okay for public life. This actually resulted in a situation where by the early-1940s you had Japanese as the language of everyday use in professional settings, and with the sort of social support that people in the indigenous population were using it and having pretty good positions in commercial endeavors because they were able to rely on Japanese. The gradualness of Japanese language policy was such that by that point, enough people had grown up with it that they were comfortable to use it. I knew of some elderly Atayal folks who still to this day use Japanese with each other, since it's what they grew up with.
The problem came around 1945 when the KMT took over and with heavy hands shut down all Japanese use, essentially demanding everyone use Mandarin, a language not native to the island. Today, President Tsai talks about Taiwan's indigenous languages, by which she means Aboriginal languages but also Hakka and Hokkien. This is a massive change of pace for Taiwan, which basically effectively outlawed all public use of non-Mandarin languages until the 1990s. The Mandarin policy kicked in right away, people protested, and it contributed to the crackdown that hit its peak with the 228 incident. But for the most part, no one but the waishengren were using Mandarin at home, and they were almost entirely limited to places like Taipei. Places like Hualien and Hsinchu had large Hakka populations, as well as a few Hakka pockets elsewhere further south, but otherwise once you got to Taoyuan it was Taiwanese (Hokkien) until you hit the southernmost point of the island (Formosan languages aside, but those which were spoken in the lowlands were effectively wiped out entirely by the Japanese).
That's not to say the KMT didn't have effective ways to spread Mandarin. Education was obviously a bit one, but Mandarin was also the language of the military, and with compulsory military service being a thing and also being a huge tool of socialising the youth, it helped Mandarin have a much greater presence among the average person. They still weren't speaking it at home, but it helped Mandarin really get cemented as an official language. That and the fact that broadcasts were forbidden to be in anything but Mandarin meant that there was little chance of people in urbanised areas not being able to at least follow along.
Mandarin never really got popular because it has a massive amount of negative cultural baggage.
In addition, why is it not a national language when Hakka is?
I mean, it is, but only as of December last year. Same for the Formosan languages. So yeah they're official, but this has been the case for less than a year. The purpose in these being made official was to help keep them from disappearing. Taiwanese is under much less of a thread than the Formosan languages, and of course to a lesser extent Hakka. The president is Hakka and Paiwan, so that probably has something to do with it, but also Hakka culture groups are massively popular in Hakka communities, and have regular festivals and holidays and competitions and the like. (anecdote warning: The Hakka community in Hsinchu was absurdly active when I was living there and learning Hakka myself. But this was in sharp contrast to how much Hakka was actually used in daily life, which was "not much".) Hakka is a tiny language with five or so major dialect groups just in Taiwan and they really don't have much standing other than showing up, after Taiwanese, on the train announcements (which are in the Siyen dialect, the largest of the few spoken there).
As to why Taiwanese isn't a national language, well it's hard to answer "why not" questions. The answer is just that it's not. Maybe if Taiwan loses a few more embassies it'll happen. I give it 5 years.
I did an AskHistorians podcast a couple years ago where I talked a lot about this topic if anyone's interested. It's called something like Language Policy in Asia. Otherwise I'm happy to keep answering follow ups here if people have them.
Quick shout-out for r/hakka.