The legislation was amended after lobbying by religious groups
MPs have backed a government move to allow sex education to be taught in England in a way that "reflects" a school's "religious character".
The amendment to the Children, Schools and Families Bill was passed by a majority of 345 in the Commons.
Opponents had said ministers showed "cowardice" by making the amendment in the face of religious groups' lobbying.
The government insisted there had been no "watering down" of plans to make all schools teach the biology of sex.
The "religious character" amendment to the bill was passed without debate due to a lack of parliamentary time.
'Major step forward'
The change follows what the Catholic Education Service claimed had been a period of "extensive lobbying".
Opponents of the amendment have argued it could allow faith schools to teach sex and relationships educations in ways that are homophobic, gender discriminatory and in violation of principles of human rights.
Keith Porteous Wood, executive director of the National Secular Society, said the government had "once more bowed to pressure from the Catholic Church, betraying the children in faith schools who have a right to objective and balanced sex education".
"This cowardice will blight many lives," he added.
But Schools Secretary Ed Balls said the bill was "a major step forward" in requiring all schools not only to teach children about the biology of sex but also about relationships, and in lowering the maximum age for parents to keep their children out of sex education classes from 19 to 15.
He said: "There is no watering down of what is actually an overdue change.
"There is no opt-out for any faith school from teaching the full, broad, balanced curriculum on sex and relationship education and that is a huge step forward."
Mr Balls added: "Every school will have to teach the full curriculum in a balanced way that respects equality and is not discriminatory, but of course what we are saying is they can explain the views of their faith.
"Catholic schools can say to their pupils that, as a religion, we believe contraception is wrong, but what they can't do is therefore say they are not going to teach about contraception."
The full, amended, bill was passed by a Commons majority of 91 and now goes to the House of Lords.