Not just Title 42. A Trump EO. There were several types of rationale' including threatening Mexico with tariffs, but Trump stopped the flow of migrants. Title 42 was just another facet of the "remain in Mexico" policy.
en.wikipedia.org
On November 9, 2018, then-U.S. president Donald Trump issued a proclamation suspending the right of asylum to any migrant crossing the
US–Mexico border outside of a lawful port of entry.
[8] U.S. District Judge
Jon S. Tigar of the Northern California District Court issued a November 19 injunction against implementing the policy, which was upheld by the US Supreme Court on December 21, 2018