SAN FRANCISCO — If the outlook has been cloudy for cy pres awards in federal class actions lately, on Monday thunder rumbled, with a downpour surely on the way.

After weighing the case for a month, the U.S. Supreme Court finally signed off Monday on a $9.5 million settlement of a Facebook class action that leans heavily on cy pres relief—in this case, $6.5 million awarded to a charitable foundation, controlled partly by Facebook, to educate the public about online privacy.