SALT LAKE CITY — A bill that would allow transgender people to legally change their gender identity failed to pass the Utah State Senate after an emotional debate Friday.

Senate Bill 138, sponsored by Sen. Todd Weiler, R-Woods Cross, had been criticized by both transgender rights activists and social conservatives but for different reasons. The trans community felt the bill didn’t go far enough; social conservative groups like the Utah Eagle Forum felt it went too far.

Speaking on the Senate floor on Friday, Sen. Weiler tried to argue that’s why the bill was good, because not everyone got what they wanted.

“My decision has been to try to love people,” he said through tears.

The bill would have created a pathway for people to legally change their gender through the courts. Right now, the Utah Supreme Court is considering a case where some judges have refused to grant changes to a birth certificate.

While social conservatives blasted the bill for doing anything at all, transgender rights activists objected to SB138’s provisions including demanding that someone be over 18 and that the birth certificate would show it had been amended.

Sen. Weiler faced pushback from his colleagues on the left and right. It also led to the sharing of stories from constituents whose children are transgender. Sen. Dan Hemmert, R-Orem, read a text from a staunchly GOP colleague.

“These are real issues. It’s not pretend. These kids are not perverts or wackos,” he read. “They’re just trying to fit in.”

Sen. Jim Dabakis, D-Salt Lake City, said he had been to many funerals of trans children who had been lost to suicide. He shared with his colleagues the photo of a child who identified as a girl and had been bullied for it.

“We don’t have to approve it,” Sen. Dabakis said. “We give people the freedom to make those decisions.”

In the end, both an amendment favorable to the transgender community and the original bill failed to pass. Sue Robbins, a transgender rights activist and chairwoman of the Utah Pride Center, watched from the gallery. She had mixed feelings on it.

“I see a little bit of a win in that we have a lot of support down there for something to happen,” she told FOX 13. “But as we heard different senators talk we heard different levels of understanding and that’s where the loss is. We are not educated right now and we need to continue that.”

The Utah Supreme Court could rule in a few months in the birth certificate case.