Digression: why do sites like Wikipedia and Twitter use different URLs for their mobile, given that in the end it’s essentially the same stuff being served?
For Wikipedia, I imagine they have interests in making the content most accessible on the maximum number of devices. Which means pages crafted to be lightweight and minimal Javascript. Yes, you could do that all in one page, at the altar of developer velocity, but I think the strict isolation is user forward.
Wikipedia launched that in July 2013 in response to rising web traffic and the existing site not working well on mobile browsers. That was preceded by Wapedia, an independent site that started in 2004 to provide a reformatting proxy for mobile use: https://en.wikipedia.org/wiki/Wapedia
The basic answer is that early on the tooling wasn't there to support very difference devices from the same HTML. You could try tricks to detect mobile devices and serve different content. But it was much easier just to let people decide which they wanted.
I haven't kept up, but I know the tooling keeps improving, so I expect that few people today are creating mobile-specific URLs, and that the existing ones will go away in the long run.
My guess is that it was easier to set up that way at the time, and then the configuration was kept when a mobile version was integrated into MediaWiki itself.