One reason to randomize is that the treatment can alter behavior, which can change subsequent health outcomes through a non-pharmaceutical channel.
Let's say drug A works better at lifting mood, so more of the folks who get drug A on Day 1 go out drinking because they feel so much better after taking it. As a consequence of that changed behavior, when they get Drug B on Day 2 they are extra gloomy because they are hungover, which will make Drug A seem overly effective. This will even be true if there are no lingering effects of drug A itself.
Even a crossover design will not help. The folks who get Drug B on Day 1 are more likely to stay at home, so they don't have the pounding temples and nausea reducing their wellbeing under Drug A on Day 2 to offset the bias. Their Day 3 mood may altered, but by that point the are buying beers with their guinea pig earnings and the study is over.
Obviously, getting drunk is a silly example, but you might imagine other types of behavior (diet, exercise, risk taking, attrition from the study, self-medication), that can alter potential outcomes or create selection through non-pharmaceutical channels in between the two treatments.
This sort of behavior response is not applicable in all settings, so you do have to spend some time worrying whether you are making an apples to apples comparison (other than the treatment).