Stabile shook up the race last week by airing a TV ad criticizing McVay because his fiancee and sister-in-law are on the Allegheny County court payroll.
McVay called the ad unfair because he did nothing wrong, and a Pennsylvania Bar Association panel asked Stabile to take down the ad, but he has refused, The 56-year-old Stabile is a corporate lawyer in Harrisburg and a former Cumberland County Republican Committee chairman.
Voters also retained two sitting Superior Court judges: Susan Peikes Gantman, a Republican, and Jack A. Panella, a Democrat.
Castille, the Republican chief justice since 2008, said he plans to use his final year on the court to continue his court-reform efforts and oversee the opening of the Philadelphia Family Court building.
Castille's leadership had been questioned by reform groups, and some of his opinions - among them the legislative pay raise and legislative redistricting - have been unpopular, prompting a vigorous late campaign to overcome efforts by the tea party and reform groups to unseat him.
Castille presided over changes in the court operations following the Luzerne County "kids for cash" scandal that sent two juvenile court judges to prison. After the convictions, Castille ordered records expunged for 2,401 juvenile offenders.
Baer said he was "pleased and humbled" by his retention at a time of widespread voter discontentment. "My poll showed there was discontent among voters because of what was occurring at the federal level," he said. "I am glad voters looked at Pennsylvania and decided we were worthy of another term."