A center-right moderate who sometimes sided with the court’s liberals, he cast the vote that established a constitutional right for same-sex couples to marry and determined how far government may intrude on the right to an abortion, and whether attempts to curtail the corrupting influence of campaign contributions violated free speech.