He cited national interest concerns but was opposed by civil rights groups.
Trump administration officials say the president has a right to defend the border.
Immigrant rights groups, who argue the administration is creating a crisis at the border to score political points, praised the judge's ruling.
Gelernt said the ACLU had recently learned Mexican authorities have begun barring unaccompanied minors from applying at U.S. ports of entry.
DHS has said it wants asylum seekers at the southern border to appear at an official border crossing. Legal groups sued hours after the proclamation was issued, arguing USA law clearly allows someone to seek asylum regardless of how they enter the country.
The final version of that order was upheld by the US Supreme Court on June 26 after a protracted legal battle.
U.S. District Judge Jon S. Tigar issued a temporary restraining order on Monday, preventing the Trump administration from following through with its latest efforts to crack down on immigration at the southern border.
Al Otro Lado, one of the groups that joined in filing the lawsuit against Trump's asylum proclamation, said the only ones protesting the migrants in Tijuana "are the anti-immigrant crowd, some of whom came down from the U.S".
President Donald Trump issued a proclamation on November 9 circumventing immigration law, saying anyone who crossed the southern border between official ports of entry would be ineligible for asylum. They have said they plan to enter the U.S. Many are fleeing violence in their homelands.
The US president declared this month that America would ban any foreigner who entered the country without a visa the right to asylum.
In Mexico, thousands of Central American migrants are waiting in a crowded sports complex and squalid shelters to head north into the United States, where thousands of armed American soldiers are guarding the line to deter them from crossing.
"Our asylum system is broken, and it is being abused by tens of thousands of meritless claims every year", said the statement.
The US temporarily closed the San Ysidro border point, its busiest crossing with Mexico, on Monday to install new movable wire-topped barriers. USA troops are deployed to the border to help stop what Trump has also called an "invasion". Officials didn't say whether those people's cases were still progressing through other, more hard avenues left to them after the proclamation.
Civil liberties groups went to court to fight the ban and Judge Jon Tigar agreed with them, saying any foreigners arriving in the United States could apply for asylum.
As of Monday, 107 people detained between official crossings have sought asylum since Trump's order went into effect, according to DHS, which oversees Customs and Border Protection.
USA authorities process about 100 asylum claims each day at San Ysidro, meaning wait times will be long.