There's a whole lot of garden imagery in the play. The thing is, the gardens in Hamlet aren't necessarily the kind of places where you'd like to hang out and watch butterflies while you picnic. According to Hamlet, the entire world "tis an unweeded garden, / That grows to seed; things rank and gross in nature / Possess it merely" (1.2.6). The word "rank" refers to the fertile overgrowth of vegetation and also implies the kind of festering and rot that often accompanies lush foliage. Yuck.
Why does Hamlet see the world this way? As his speech continues, it becomes clear that his father's death as well as his mother's sexual appetite and marriage to Claudius are the causes of Hamlet's world view. In fact, the term "rank" turns up over and over again throughout the play to describe Gertrude's incestuous relationship. Consider, for example, Hamlet's description of his mother's "rank" marriage bed, which offers a rather repulsive view of sexuality.
Nay, but to live
In the rank sweat of an enseamed bed,
Stew'd in corruption, honeying and making love
Over the nasty sty,– (3.4.14).
Of course, this allusion to the world as a ruined garden also recalls Eve's temptation in the biblical Garden of Eden, which, according to Christian theology, causes man's Fall. The allusion to Eden is strengthened later in the play when the Ghost reveals that Old King Hamlet was murdered by his brother, Claudius, while he slept in his orchard:
'Tis given out that, sleeping in my orchard,
A serpent stung me; so the whole ear of Denmark
Is by a forged process of my death
Rankly abused: but know, thou noble youth,
The serpent that did sting thy father's life
Now wears his crown. (1.5.8)
Gosh. The Ghost sounds a lot like young Hamlet. Notice the way the Ghost insists the murder "rankly abused" the entire kingdom – as if Claudius poured poison in "the whole ear" of Denmark. What's more, the Ghost insists that Claudius's poison caused a scaly rash and "loathsome crust" to cover his once "smooth body" (1.5.8). This suggests, in turn, that the whole country has been infected by a contagious disease.