Measure rigidity of Ricci curvature lower bounds