My mother with dementia keeps having temper tantrums. What happened?

Normal for dementia. When your mom gets upset, her ability to think and reason declines. She's stuck in a body that is no longer functioning properly-add a muddled mind and you have the perfect storm for an anger display. She knows something is wrong, but doesn't understand it, so she becomes very defensive and irrational. Don't try to handle this by yourself, get help.
It sounds like. Her dementia has effected part of her brain involved in emotion or judgement. Talk with her doctor about what you are seeing as there may be medications that could help.