I don't think it is illegal, or at least I couldn't find anything saying it was. Here are three articles I found, and I'd assume at least one of them would have mentioned the legal trouble. Maybe I missed it?
https://slate.com/technology/2018/02/when-should-you-uber-to-the-hospital-and-when-should-you-call-an-ambulance.html
https://www.webmd.com/health-insurance/news/20170515/uber-lyft-er-trips#1
https://www.rewire.org/living/uber-emergency-room/