I call this the "It's not me, it's you" breakup method.
Sure, it can feel good at the time to tell someone exactly why you were forced to break up with them - a list of deeply personal flaws that made them unbearable to be with, and make it clear that if they weren't such a loser, you'd still be with them.
But really - telling them this isn't going to make them feel better about getting dumped. It's going to make them feel worse. They've been dumped *and* insulted. If they were willing or able to address the issue, they would have done so in the relationship, so the excuse "But I'll help them be a better person in the next relationship" doesn't fly either.
If the 'flaw' were fixable, then you could have addressed it during the relationship. If you didn't or couldn't, then telling them isn't going to change it.
There are a few specific cases where you can point to a single, large incompatibility, like "I want kids and you don't". There are also some extreme cases like "I'm leaving you because you hit me. Do not contact me again or I'm going to the police." or "You slept with my sister". Otherwise, an "I don't think we're a good match in a romantic relationship" or "We want different things out of life" are as deep as you need to go.
You can flip it and see how you'd feel if someone dumped you and said "The sex was great, but quite frankly you're boring and needy, and the way you snort when you laugh is like fingernails on a chalkboard".
Mind you, I do think you have to deal with things differently when you're dealing with a marriage or cohabiting relationship, rather than dating (or even extended, exclusive dating) There's generally no way that's not going to be messy, if for no other reason than having to find a new place to live, splitting joint assets, and deciding who gets the dog.