I've always read a lot of stuff about it being hard to keep secrets that are juicy and that you want to tell the whole school for gossip purposes, but I don't usually have a particularly hard time with that, and I didn't when I was younger either. I have trouble keeping a secret (and I DO keep the secret, I just have some difficulty with it) in these scenarios:
1. When knowing the other person's secret is affecting me a lot and I need to talk to someone about how I'm feeling about it. When I was younger, I would usually tell my mom the secret in this case. I used to feel like that was okay because my mom wasn't going to spread a rumor at school about it or tell anyone else. Nowadays I won't tell anyone, or I'll only talk to other friends who also know about the secret. Also, when I share a dark secret of my own with a friend, I'll usually let them know which other friends I've shared it with so that they can talk to those people about it if they need to. This is sort of impossible to do in a school setting because the secret would get out to other people who aren't supposed to know, but it works well now that we can choose who to hang out with and when we want to do it.
2. When I think that sharing the secret would help someone. Sometimes I'm in a scenario like this: One friend confides in me that she's terrified of amusement park rides and she wants me to keep that a secret. Then another friend is having their birthday party at an amusement and is really upset that the first friend won't come. I don't tell the first friend's secret, but I really wish I could tell it because it would resolve the conflict.