WASHINGTON—The Supreme Court on Friday made it easier for property owners to challenge land-use regulations and seek compensation from the government, a ruling that revealed deep divisions between the court’s conservative and liberal camps.

The court, in a 5-to-4 decision written by Chief Justice John Roberts, sided with a Pennsylvania woman who challenged a requirement by the rural community of Scott Township that she provide public access to a gravesite on her 90-acre property.

The...