Driving the 3-phase motor yes, that can (and is usually) done with a dedicated real-time MCU/ASIC. But the interface with the backend, the actual brains? You need to deal with GPS, authentication (unlock via app/bluetooth/...), ride logging, debug data. And at that point an ESP32 or heaven forbid an Arduino won't cut it either, and you don't want to spend hundreds of hours on wrangling with some custom higher-power embedded board because that is real nasty to get right. So you use an RPi because the extremely broad user base has already solved every issue you might have run into.
Besides, the innards of e-scooters can be had as whitelabel solutions, no one engineers these themselves. All people do is design the outer shell based on a design kit, do whatever needs to be done to pass legal certifications, and integrate some sort of brains if it's for a fleet.