(CNN) The House passed legislation Friday that would protect those living in states where it's legal to discriminate based on sexual orientation and gender identity in employment, housing and other services as well as access to public accommodations such as restaurants.

The bill, known as the "Equality Act," would amend the Civil Rights Act of 1964 and other civil rights laws to include sexual orientation and gender identity as protected characteristics. But critics argue it raises serious concerns for religious communities as well as women's sports.

It passed largely along party lines in the Democratic-controlled House, 236-173, but it's not expected to be taken up in the GOP-led Senate. Eight Republicans supported the bill.

Conservatives argue the bill threatens freedom of speech, religion and women's rights. In a heated floor debate before the vote, Republicans pointed to a provision in the bill that says an individual could not be denied access to a restroom, locker room or dressing room based on their gender identity. Opponents say that would force women and girls to share private spaces with men. Critics also say the bill could facilitate men participating in women's sports if they identify as female.

"Requiring biological females (to) face competition from biological males will mean the end of women's sports in any meaningful sense," said Rep. Greg Steube, a Florida Republican.

Read More