And it makes sense. You can buy, using real money, a virtual ticket for a virtual item. Then that virtual item can in turn often be sold to others for real money. In other words, players can participate by gambling real money in return for less or more real money.
In short, it is gambling. Not all countries make gambling illegal, but those who do, should treat loot boxes the same. And virtually all countries make gambling illegal for minors, and there's currently no working mechanism in play for 15 year olds not to be able to play these games.
Currently in the Netherlands it's required for the proceeds of loot boxes to be tradeable in the real world, giving them economic value, for it to be considered gambling. If it's purely virtual, it's not gambling but just part of the game. (you can question this of course.) The problem is that it didn't matter for the Dutch government whether the items were traded on external platforms (which are often in violation of the games EULA itself), or on a platform of the game itself.
What would help stay legit is for the games to prevent loot box items from being traded between characters at all.
Here's the weird thing though. My entire childhood was filled with opaque plastic packs of cards, pokemon cards, football cards etc. You didn't know which 5 cards were in there. The cards were semi-randomly distributed in the packs in the factory, just like these loot boxes are semi-randomly generated by an algorithm. And you'd pay, not knowing what you'd get. And indeed, sometimes you paid $10 for a pack with a rare pokemon you could sell for $100. That was gambling too under this definition.