Solved. The app I am using to create the teams events was missing these permissions:
TeamSettings.Read.All
TeamSettings.ReasWrite.All
As soon as I added them, onlineMeetingProvider was correctly set to teamsForBusiness and isOnlineMeeting to true.
onlineMeetingUrl is always null though, but it's possible to get the meeting url from the "onlineMeeting.joinUrl" property, which now is correctly populated (without the proper permissions it wasn't).