I think this is the kind of question that can only be answered: it depends...
...on:
- which style of music you're looking at,
- which era you're talking about, and
- what level(s) of artistry you're including.
The best composer of all time (any style, any era, any level of artistry) is Mozart. Hands down, end of discussion. You only have to listen (really listen, not just wait for it to finish) to one or two of his pieces to come to this conclusion.
But, if we're talking about the 1960's (McCartney's era) and pop music (his style) and AM-radio, grab-the-masses level of artistry, then yes. McCartney's the one... Sort of.
Even he was closely rivaled by Jaggar, Richards and Lennon, all of whom wrote about deeper subjects most of the time. So, if you include all songs of the era and not just AM hits, the answer is: maybe.
If you're talking about pie-in-the-sky, rose-coloured-glasses, love is everywhere and it's a beautiful day, and you've got your blinders on so all you can see (or All You Need) is love, you just can't beat McCartney, especially if you're talking volume (number, not loudness). Although, it's commonly believed Lennon wrote
that song.
And if you're talking about generosity, again it's McCartney. He wrote songs to cheer people up or sympathize with whatever they were going through such as Hey Jude (Julian Lennon was depressed by his parents' divorce), For No One (George was upset about breaking up with Patty), Give Ireland Back to the Irish (during the height of pro-Irish sympathy in England) just to name a few.
And let's not forget that every love song he wrote after Lovely Linda was to make the love of his life feel special.
So, which of those are you talking about?