Why would Hamlet describe Denmark as a prison in Shakespeare's Hamlet?
Hamlet's description of Denmark as a prison has mainly to do with his feelings about the place after his father's murder. He longed to return to his studies and the relative moral quiet of Wittenburg but was urged to stay by his mother, to whom he obviously feels a great loyalty, as well as by the desire to see if he can figure out and avenge his father's murder.
Because of this, he feels he is confined there and cannot be free, thus the feeling that it is a prison. This comes out several times in the play, perhaps the most blatant when he is speaking to Rosencrantz and Guildenstern.