The widespread sexual abuse of elderly residents is a “national shame”, a top inquiry hears.