I believe that the movie most similar to Shakespeare'sHamletisThe Graduate,starring Dustin Hoffman as Benjamin Braddock and released in 1967 when Hoffman was a very young newcomer. Like Hamlet, Benjamin returns home from college and discovers that his real education is only just beginning. Like Hamlet, Benjamin begins to understand that reality is quite different from books and that there is a great deal of secret sinfulness in the adult world.
It is significant that when Hamlet has his encounter with the ghost of his dead father in Act 1, Scene 5, he says to himself:
Yea, from the table of my memory
I'll wipe away all trivial fond records,
All saws of books, all forms, all pressures past,
That youth and observation copied there . . .
He realizes that his college education didn't prepare him for understanding the real world in which many people are not guided by philosophical or idealistic principles but by selfish motives. Benjamin has the same realization, especially after he gets involved in a secret affair with Mrs. Robinson, a woman who is much older and more worldly wise than he.