In general it is a good idea, as it has been amply demonstrated that bans do not serve to end the activity, but relegate it to the underworld, dependent on mafias and are more dangerous for players, apart from the fact that the state does not collect taxes for them.
That is a very wise decision and should have been done earlier. Just imagine the tax revenue they have lost by not doing it before. I agree with the opinion that it is more about generating revenue. The gambling industry is one of the biggest tax contributors, so doing it is a good move. There is no point in not allowing it. Just legalize them if you can't put a clear stop to it or eradicate it completely.
Apart from that, which is a good reason, by making it legal the state can control it better, and can force operators to introduce responsible gambling measures, for example, which are measures that protect the player.