The house in Chattanooga, Tenn., was the perfect venue for the quiet wedding the two men were planning for August. They would hold the ceremony in the glass-clad sunroom of the house, set on two acres that backed up to the woods. They started to write their own vows. The owner of the house, the couple’s friend Gabriel Biser, agreed to officiate.

But then Mr. Biser, 36, got bad news that brought his friends’ plans, and those of many others in Tennessee, to a halt. On May 21, Gov. Bill Lee, a Republican, signed a bill that amended state law to prevent ministers ordained online from solemnizing weddings, starting July 1.

“It’s summertime in the South,” Mr. Biser, a minister who was ordained online in 2015, said. “In the evening, we get fireflies. It is kind of a magic time for us. It was going to be a very intimate ceremony. Then we found out about this law.”

So Mr. Biser , two other ministers ordained online and the Universal Life Church Monastery, the nonprofit organization that ordained them, filed a lawsuit in federal court last month that alleges the new legislative action violates their rights of expression and religion.