The 2014 law forbids registrars from officiating at unions with Bangladeshi nationals and between Rohingya couples, after the government said it was being abused to obtain citizenship.
More than half a million Rohingya fled to Bangladesh from Myanmar in 2017.
The case was raised by a man whose 26-year-old son had been evading police since marrying an 18-year-old Rohingya.
Police had been searching for Shoaib Hossain Jewel since October, when they found out about the marriage, according to local reports.
Mr Jewel reportedly met the Rohingya woman while her family were sheltering at a local Muslim cleric’s house. He was said to have travelled hundreds of kilometres to find her in a refugee camp after her family were moved on from his village, before the couple got married.
At the time it was reported to be the first known union between a Bangladeshi and a Rohingya since an upsurge in violence in Myanmar against the persecuted ethnic minority forced hundreds of thousands to flee across the border.
Explaining the law in 2014, government officials said they believed wedding certificates were being used to try and claim legal documents including Bangladeshi passports.
Under it anyone found to have married a Rohingya can be sentenced to seven years in prison.
Mr Jewel’s father, Babul Hossain, was outspoken about his support for his son’s marriage and filed a petition against the law.
“If Bangladeshis can marry Christians and people of other religions, what’s wrong in my son’s marriage to a Rohingya?” he told AFP news agency in October.
The High Court in Dhaka dismissed his challenge on Monday, and ordered him to pay 100,000 taka (£885; $1,200) in legal costs.
It also rejected a request to protect Mr Hossain’s son from arrest.
It was unclear if the couple were set to face further action following the ruling. (Courtesy BBC)