So if needy friends are annoying, why are you friends with them?
A needy friend is better than no friend.
You like to feel needed.
You'd feel guilty if you weren't there for them.
Sometimes your needy friend is fun when they're not being so needy.
They weren't that needy when you first became friends.
How do I deal with a needy friend?
Set boundaries and stick to them. For example, make it clear that you don't take phone calls in the middle of the night.
Focus on doing things you both enjoy. This keeps them from wallowing in self-pity.
Be honest about what's bothering you. Tell them their problems are just too much for you.
Recommend they get help from an adult. Encourage them to talk to their parents or a school counselor if you feel that they might need some professional help.
Take a break. If you need to take a break from being around them, take it.
Distance yourself. Downsize the time and effort that you put into the friendship.