Berek won 226 votes out of 437 lawmakers present, comfortably above the absolute majority of 219 required.
Artur Kotowski, the candidate put forward by the opposition Law and Justice (PiS) party, received 184 votes.
Opponents argued that Berek, who recently served as a minister in Donald Tusk's government, should not sit on the tribunal.
Presidential aide Zbigniew Bogucki cited what he said were procedural concerns and opposition from non-governmental organisations, including the Helsinki Foundation for Human Rights.
He also accused the ruling coalition of hypocrisy, saying it had abandoned its own past calls for judicial independence.
Deputy Prime Minister and Defence Minister Władysław Kosiniak-Kamysz hit back, saying "no presidential representative has ever gone so far" in trying to sway the public in this way.
Berek's candidacy had also drawn criticism within the ruling coalition itself, with some lawmakers pointing to 2024 legislation, ultimately vetoed by then-President Andrzej Duda, that would have barred former government ministers from becoming judges for four years after leaving office.
Adrian Zandberg, co-leader of the left-wing opposition Razem (Together) party, held up a photograph from 2016 rule-of-law protests under the previous government, telling Tusk directly: "You are simply betraying these people."
The vote fills a vacancy left by Justyna Piskorska, whose term expires on September 18, Polish state news agency PAP reported.
Constitutional Tribunal judges are elected individually by the lower house for nine-year terms, by an absolute majority of votes.
(ał/gs)
Source: polskieradio24.pl, PAP