Money couldn’t buy friends, but you got a better class of enemy.
Terence Alan "Spike" Milligan (1918-2002) Anglo-Irish comedian, writer, actor
Puckoon, ch. 6 [Mrs. Doonan] (1963)
(Source)
The phrase, usually in the present tense, became a popular one of his, as in Norma Farnes, Memories of Milligan, "Spike on Spike" (2011): "Money can't buy you friends, but it does get you a better class of enemy," or the variant "Money can't buy you friends, but you get a better class of enemy."