The politicians are getting funded/paid (lobbying/donations) by the very same people/companies that pay the ad revenue to those media. Why on earth would politicians legislate against their actual bosses? (As a real life reminder - a dog that bites the hand that feed him is put down). Courts btw don't make up shit.. they 'judge' (verb) with the criteria of 'what does the law define'. So if politicians legislate wisely, courts will enforce any 'parliamentary' and/or executive order to ban the advertisements of medicine.
But they won't. Not until push-comes-to-shove, and the true bosses will reposition to 'the next thing' (smoking, sugary-foods, medicine) and then they will allow the politicians to finally block meds ads. In which case the 'next wave' will begin. Story as old as time...