Republican presidential candidate Ted Cruz on Thursday threw his support behind a controversial law in North Carolina that targets the LGBT community.

Passage of House Bill 2 has spurred at least two companies – PayPal and Deutsche Bank – to freeze investment plans in North Carolina, politicians to restrict state employee travel and artists to cancel performances.

The bill prohibits cities from approving LGBT protections and bars students attending public institutions from using the bathroom that does not conform to their gender at birth.

Supporters of the bathroom restriction say it's needed to keep women and children safe from men pretending to be women entering the girls' restroom. Opponents note that laws in other states that allow transgender people to use the bathroom of their choice have not led to such incidents.

(Related: Delaware Gov. Jack Markell debunks “bathroom predator” myth behind transgender bills.)

“The state has the power to pass their own laws to make a determination that men should not be going to the bathroom with little girls,” Cruz said during an MSNBC town hall conducted in Buffalo, New York.

“As a father, I'm not excited about men being able to go alone into a bathroom with my daughters. And I think that it is a perfectly reasonable determination for the people to make,” he added.

Cruz went on to criticize businesses opposed to the law, claiming that they had surrendered to political correctness and were “trampling” on religious liberty.