It is the club's first La Liga title in four years and they edged out Barcelona, who beat Gimnastic 5-1, because of their head-to-head record.
Beckham, who is set to join the LA Galaxy, was not on the pitch at the final whistle having been replaced by Reyes, but he joined the raucous celebrations at the Bernabeu.
"I couldn't have dreamt it any better," said Beckham.
"It's been about winning the title for the last six months - and we've deserved it tonight.
"It's been an incredible experience, but all I remember now is the great things. Winning this tonight now puts to bed everything else."
The England star was joined by his three sons on the pitch and was given an emotional send off, as was Brazilian left-back Roberto Carlos, who is joining Fenerbahce after 11 years in the Spanish capital.
But for much of the night it looked as if Barcelona would be the team and city celebrating come the final whistle.