The resolution is the first passed by the Security Council to tackle sex abuse claims against peacekeepers.
It was passed by 14 of the 15-member body, with Egypt abstaining.
Last year there were 69 allegations of child rape and other sexual offences by peacekeepers from 10 missions. The number rose from 52 in 2014.
The allegations involve military personnel, international police, other staff and volunteers.
Under UN rules, it is up to the country that contributes the peacekeepers to investigate and prosecute any soldier accused of misconduct while serving under the UN flag.
But the organisation has been criticised for failing to act quickly on sexual abuse allegations made against peacekeepers.
Drafted by the US, the biggest funder of UN peacekeeping missions, the UNSC resolution endorses a recent decision by UN Secretary General Ban Ki-moon to repatriate military or police units where there's credible evidence of sexual abuse.
The resolution also calls upon the UN to replace contingents where allegations are not properly investigated.
Egypt put forward a last-minute amendment that would have added criteria for the repatriation of entire contingents, a move US Ambassador Samantha Power said would have "watered down" the resolution.
The amendment was backed by Angola, Russia, China, Egypt, Venezuela but fell short of the nine votes needed for approval.
Some countries have raised concerns that soldiers innocent of any wrongdoing might fall victim to collective punishment.
Last August, the UN envoy to Central African Republic (CAR), Babacar Gaye, was sacked amid multiple allegations of sexual abuse by peacekeepers.
It came after Amnesty International alleged that a 12-year-old girl was raped by a UN peacekeeper.
The 10,000-strong UN force, deployed in 2014 to help restore order in CAR, has also faced allegations of sexually abusing street children.
Last December, an independent panel called the UN response to allegations in the CAR "seriously flawed" and a "gross institutional failure".
It accused senior UN officials of abusing their authority by failing to take action over allegations of abuse by soldiers from France, Equatorial Guinea and Chad.

Hugh Shaw, the UK government official overseeing the salvage operation, said preparations were being made to allow the Hawk to begin the journey to Malta.
From Malta the 17,000-tonne drilling rig is to be taken to a yard in Turkey to be broken up.
The structure ran aground at Dalmore on Lewis in a storm in early August while being towed to Malta.
Last week, Transocean Winner was floated on to the deck of the Hawk, a semi-submersible ship used for transporting large maritime structures over long distances.
The UN Security Council has adopted a resolution calling for the repatriation of peacekeeping units whose soldiers face allegations of sexual abuse.
[NEXT_CONCEPT]
The rig Transocean Winner is expected to be moved on a heavy lift ship from Broad Bay, Lewis, on Wednesday.