Normally I would be OK with microtransactions and even loot boxes, but there is a big problem - companies get too greedy. They then design the game around the microtransactions so that the player are "strongly encouraged" to spend real money. Loot boxes and premium currency are ways to trick people into spending more.
Premium currency decouples the prices of items from real money value, so you do not see that you are spending $10 for something. You spend 400 gems, which you buy for $10, but since the actions of buying the gems and buying the items are separate, it is easier to forget the "exchange rate".
Loot boxes trigger gambling addiction in people prone to them. It does not matter if you can win real money or not, the whole idea is exactly the same. Even if you do not get addicted, you still spend more money on the loot boxes as opposed to buying the item that you want outright. What is even worse is that the odds of getting good items can be changed at will (and can be different for different players - you buy a lot of loot boxes - lower chance for you) and are not mandated by any law. Unlike, say, a casino where the gambling machines have to have a certain percentage of winnings - it would be easy to rig a machine to never pay out anything, but if you get audited and that is found out, expect some large fines.
Children are more susceptible to getting addicted (probably not shocking) and, at least in my country, they are not even allowed in a casino (as a comparison, children are allowed in a bar, just not allowed to drink alcohol) even if it's just to watch the adults gamble.
Game companies know this and they count on it. They know that a lot of people won't spend any money (or very little) on the game, so they want to get the "whales" - people who spend thousands of dollars on in-game items. Games are optimized for microtransactions on purpose - playing the game without spending real money should be just fun enough for you to play and seriously consider spending money on the items that would make it more fun to play: if it's too fun, then you won't spend money and if it's not fun enough you won't play the game at all.
I think that cosmetic microtransactions are kinda OK, but the game should be rated at least teen (no to getting little kids to empty the bank accounts of their parents). Pay-to-win is not and loot boxes are gambling. If you want to put loot boxes in your game, then it should be rated adult only and placed together with the porn games.