There are two factors to this.
1. If your partner is not in a PhD program themselves, then you can rely on them during what I call “crunch time”, and there are a few of those in every PhD when you’re doing 16 hour days 7 days a week just to get something out of the door. Single students don’t get that luxury and thus inevitably have to be miserable during that period.
2. Secondly, successfully navigating a relationship/marriage takes a lot of the same skills as successfully navigating a PhD. A good PhD at the end of the day is built on a lot of compromises: between your vision and your advisors’, the fields’, your collaborators, and if you’re interning, your industry partners. A relationship teaches you how to navigate that without burning bridges, which may not be true for a headstrong “I’m gonna change the world but I don’t know how” PhD students.