In 2018 the Supreme Court declared the prohibition unconstitutional, and gave the legislature a deadline to pass a legalization bill - all the rules necessary for dispensing, growing, etc.
https://en.wikipedia.org/wiki/Cannabis_in_Mexico#2018_Suprem...
The deadline came and went several times, with a few extensions, and the ruling today was the court decriminalizing it on their own because the legislature couldn't get it done after 3 years and were asking for another extension (see below; they originally had 90 days to do it and were granted over 30 months worth of extensions).
https://www.marijuanamoment.net/mexicos-supreme-court-strike...
I haven't tracked down what prompted the 2018 ruling.
Edit: What I've found:
Mexico seems to have a system where 5 similar rulings on the same matter by the Supreme Court set binding judicial precedent for all other judges, and starts a timer whereby the legislature must resolve contradictions. 2 seemingly minor cases in 2018 gave them the 5 needed and started the process:
https://www.marijuanamoment.net/mexican-supreme-court-strike...
Seems like this is about as far as I'm going to get without learning Spanish.
Edit2: Probably the last update, but I found a bit about the "5 Ruling" thing:
> Later, if the Chambers or the Full Court set case law by five consecutive and uninterrupted decisions, the Supreme Court, once again, will inform the issuing authority of the norm in order to amend the un-constitutional part of the norm within ninety days.
> If the unconstitutionality problem persists and it is not solved, the Full Court, with the vote of eight of its members, will expel the norm from the Mexican legal system. If it is a criminal norm, it may have re-troactive effects. It must be noted that this procedu-re is not applicable to norms involving tax matters.
https://www.scjn.gob.mx/sites/default/files/pagina/documento...