It's interesting to compare interpretations of the ending. Here is Slant Magazine's Ed Gonzalez:
Viridiana learns her lesson, religious hymns give way to Shake Your Cares Away, and her rituals of denial usher in a very wholesome game of cards. And with that, Buñuel seems to welcome the girl into the real world.[…]
… whilst Roger Ebert (who, perhaps not coincidentally, comes to an accommodation with "Buñuel the fetishist"…), writes that:
As she joins the game, the cousin says he was sure that sooner or later they would be playing together. Fade out on the unmistakable implication of a ménage a trios. […]
Viridiana is preparing to start her life as a nun when she is sent, somewhat unwillingly, to visit her aging uncle, Don Jaime. He supports her; but the two have met only once. Jaime thinks Viridiana resembles his dead wife. Viridiana has secretly despised this man all her life and finds her worst fears proven when Jaime grows determined to seduce his pure niece. Viridiana becomes undone as her uncle upends the plans she had made to join the convent.