What does something is rotten in Denmark mean?

Originally it's the ominous start from Shakespeare's Hamlet "There's something rotten in the state of Denmark..." It referred to the foul play involved in the plot.