Hamlet speaks this phrase because he feels that he was cursed from birth to have a bad fate, with difficulties.
We can arrive at this answer because:
Hamlet is complaining about being born an heir to the throne.
He believes that this kind of birth gave him a cursed fate.
That's because, in addition to having to deal with his personal problems, he was born with the responsibility of having to deal with the problems of his country.
He feels overwhelmed and believes all his problems are not the result of a cursed fate.