I'd say it was probably more a matter of choosing your battles/prioritizing the evacuation. Tommen is young, sweet and able to be influenced. Joff on the other hand is older, headstrong and cruel.
If he had ordered Joff (along with everyone else) back to the red keep immediately he'd have likely hastened the coming of the riot without getting anyone to safety first for 2 basic reasons.
1) Joff as king is still expected to be performing some level of protocol. Waving at the small folks, handing out food/coin to the poor ect. Hurrying him back to the keep would alert crowds to something being wrong/there being weakness amongst the royal party and the mob may well have had the courage to act sooner rather than later.
2) Joff would have fought Tyrion. Joff would likely have refused to go back and would likely have showcased more of his cruelty sooner. Thus onlookers might well have become even more outraged from the get go.
By sending Tommen back first Tyrion got the heir to the throne to safety before the outbreak of violence.