The duration between doses was chosen because it was the minimum plausible time that the second dose was likely to provide significant additional benefit, and therefore the fastest to test. It's entirely plausible given what we know about other vaccines, that delaying the second dose 8-12 weeks may actually have been more effective long-term, but if they'd done that the end of the testing (and therefore approval) would have been delayed another 4-8 weeks.
Surely this would present no more moral dilemma than having a control group in the first place. It's just a question of numbers and resources, and if there's ever been a vaccine trial in history that could afford to throw numbers and resources at the problem, this is it.
Was there some legal or regulatory reason not to do this obvious thing?
However, they were still optimizing for speed: they presented results to regulatory agencies as soon as they reached a threshold number of covid infections in the group, which allowed them to demonstrate efficacy.
If instead they ran a split-dose trial, the results from each arm would have less statistical power, so the trial could not conclude until it sees more covid patients, taking longer overall.
They likely ran the trial with 40,000 patients because that was all the qualified patients they were able to quickly contact reliably enough to include them in the study (otherwise you have study dropouts, as mentioned in other comments above).