Lotto and sports betting in its modern incarnation are very different.
Lotto was created so that people’s desire for gambling is diverted towards charity.
When I was a cashier the state owned lottery monopoly had a training session for us on how to operate the lottery machines, and it was really dystopian how most of the time was spent on encouraging us to make upsells with sales pitches and being happy about gambling.
https://de.wikipedia.org/wiki/Lotto#Verwendung_der_Einnahmen
50% for is the gamblers
23% is diverted towards the charity you mention.
16.7% is taxes
7.5% is commission
2.8% is for running the business
In other words, the "Aktion Mensch" gives around 1/4 to those in need.
* Correction, "Aktion Mensch" give close to 1/3 to those in need and less to gamblers (also 30%). But they keep more to themselves.