It started in classical Latin, says the OED, long before English was a twinkle in the Celtic eye. Mercenarius back then could refer straightforwardly to a soldier paid to serve in another country’s army or, in an adjectival form, to someone who was doing something for money when he shouldn’t have (either shouldn’t have been doing the something or shouldn’t have been doing it for money).
But etymology is a funny thing. Mercenary in contemporary English basically has two senses, and I think in most people’s minds the literal sense predominates even if it didn’t come first in history. A mercenary to most is a soldier fighting not for country but for pay.
My impression is that the adjective, always pejorative (“Edward had mercenary reasons for marrying Eleanor”), in most people’s minds derives from that literal sense. But why? What’s so wrong with being a soldier for pay that its adjectival form would become only and ever a slight?
My humble guess is that people do see something intrinsically wrong with killing in war when you’re not doing it in self-defense. Another way of putting it: it isn’t worth giving your life for money, only for kith and kin. Someone who takes that risk is essentially elevating money to a level of importance it simply doesn’t deserve. A colonial American matriarch could comfort herself with the thought that her son’s blood bought freedom for his nation. But what were the Hessian mothers supposed to do?
A Christian is not mercenary, C.S. Lewis has pointed out, for striving after the reward of God Himself. But if he tries to use his relationship with God to get stuff, he’s been converted to Hessianity.