Human rights campaigners lost their bid on Thursday for a High Court ruling to say the government had acted unlawfully.
The government introduced measures to stop Czech Roma from entering the UK in case they might be seeking asylum.
Campaign group Liberty, acting for the European Roma Rights Centre (ERRC) and six anonymous Czech gypsies, had claimed the new controls penalised the Roma.
'Incompatible'
They argued in the High Court that the UK immigration controls set up at Prague Airport were operating in contravention to international law.
Methods used for screening potential asylum-seekers discriminated against the Roma and were incompatible with the 1951 Refugee Convention and human rights laws, they argued.
But Mr Justice Burton, sitting in London, rejected all the grounds of challenge and ruled that the government's measures were lawful.
Commenting on the decision, a spokesman for the Home Office said the government was pleased.
"This vindicates our view that pre-clearance is an entirely proper use of immigration powers and has been operated in a non-discriminatory way."
Czech Roma often complain of discrimination in their homeland and are often subjected to racially motivated attacks.
Many have migrated to Britain, Belgium and Canada.
Evidence 'strong'
A group of 48 immigrants was deported from the UK back to the Czech Republic in front of the media at Stansted Airport in September.
During the case Lord Lester QC, appearing for Liberty and the ERRC, said Home Secretary David Blunkett had accepted that the vast majority of asylum applicants from the Czech Republic were gypsies.
The inference that there was discrimination was "strong", he said.
Lord Lester said the Home Office began its new screening practice at Prague Airport in July 2001.
Those refused "pre-clearance" for the UK were effectively prevented from travelling since no airline would carry them, he said.
Rejecting the challenge, the judge said the pre-clearance system was "no more or less objectionable" than a visa control system.
He ruled there was no obligation on the UK under the 1951 Geneva convention on refugees "not to take steps to prevent a would-be or potential refugee from approaching its border in order to be in a position to claim asylum".
But Roger Bingham, press officer for Liberty, said the screening process prevented people entering the UK as asylum seekers and then going through the normal process to seek residence.
"It risks driving people to less open and legitimate means of entry," he told BBC News Online.
"Using this, how can anyone escape persecution to a safe country?" he asked.
Liberty was granted leave to appeal the case and Mr Bingham said the group intended to use this.