The Iowa senate passed a bill that could ban universities from enforcing anti-discrimination policies in student clubs late last night.

All 29 Republicans voted in favor of it and all 19 Democrats and one Independent voted against it.

Proponents of Senate Bill 3120 say it’s about free speech on campus. The bill says that universities “shall not deny benefits of privileges available to student organizations based on the viewpoint of a student organization” or “the student organization’s requirement that the leaders of the student organization affirm or agree to the student organization’s beliefs or standards of conduct.”

An amendment just before the bill passed struck a section that said, “A public institution of higher education may prohibit student organizations from discriminating against members or prospective members on the basis of any protected status recognized by federal or state law.” The state of Iowa bans discrimination on the basis of sexual orientation and gender identity.

“I have to tell you the amendment currently being offered is basically reneging on the deal,” Iowa senator Herman Quirmbach (D) said, referring to how the bill got through committee.

“We have in essence legalized discrimination, which I believe is a very dangerous and unfortunate thing to be doing,” Iowa senator Matt McCoy (D) said.

The bill comes after a conservative Christian group sued the University of Iowa after they were denied official campus registration when they refused to let a gay student run for vice president of the group. The organization cannot use campus resources.

The group said that they don’t discriminate against gay people, they just require student leaders to accept a “statement of faith” that includes renouncing homosexuality and trans people. In other words, people of all backgrounds who don’t like LGBT people are welcome to be leaders in this organization.

Iowa senator Amy Sinclair (R) said the bill has nothing to do with that case and is instead about a Muslim student group at the University of Iowa that wants to limit their membership to Shia Muslims.

“[The removed section of the bill] could be applied in a way that would appear to target this Muslim student group, because they have that requirement for membership that they be members of the faith, which is a protected class of people,” Sinclair said.

She justified the bill by decrying “safe spaces” that block the “free exchange of ideas.” Sinclair did not address how allowing campus organizations to exclude people based on their identities is, basically, creating safe spaces.

The bill was supported by the Christian organization The Family Leader and was opposed by the ACLU and the Board of Regents of the University of Iowa, which has been struggling to respond to the distribution of white supremacist materials on campus.

“No student should be excluded from participating in groups or activities they’ve already paid for because of who they are, and this bill is an attempt to allow just that,” Daniel Hoffman-Zinnel of the LGBTQ organization One Iowa Action said. “This isn’t fair to students paying activities fees, or taxpayers who don’t want to subsidize discrimination.”

The measure now goes to the Iowa House.