They use the Russian engines because they're cheaper
More significantly, the Russian kerosene-oxygen rocket engines have exceptional performance. While the US mostly ignored kerosene after the 1960s to focus on hydrogen-oxygen rockets (and solids, for military use), the USSR kept plugging away at kerosene-oxygen engines. Until SpaceX's Merlin series of engines the US had nothing like the thrust-to-weight performance of the RD-170 family. The fall of the Iron Curtain and revelation of Russian rocket engines caused some eye-boggling in the US.
Then the US started buying those engines because, y'know, capitalism trumped patriotism. In the 1990s the Russian engines were good, cheap engines that could substantially improve US rocket performance. When the engines became expensive in the 2000s the performance was still worthwhile.
Why not just have the Russians launch your payload?
Tricky question. A few follow-up questions:
1. If Boeing uses Rolls-Royce jet engines on its airliners, why not build the planes in the UK?
2. If Chrysler and Dodge used Japanese engines in its cars, why not build the cars in Japan?
3. What about all of NASA's flights to the ISS in Soyuz capsules?
US commercial satellite operators have gone outside US borders for their launches. The Ariane family was a workhorse for the world's launches until recently. A US communication satellite was on the Long March 3B that killed at least 6 if not several hundred people. When saving money matters to a US satellite operator they're certainly willing to chase a cheaper launch.
But in this restricted case, the Atlas rockets using Russian engines primarily have US government payloads. While NASA doesn't mind launching on foreign rockets if they get the job done (e.g., James Webb is going up on an Ariane V), the National Reconnaissance Office and Department of Defense will laugh themselves into hiccups and hernias at the idea of putting one of their satellites on a "Rooskie" rocket.
As the original capitalist economist Adam Smith noted, "There seem, however, to be two cases in which it will generally be advantageous to lay some burden upon foreign, for the encouragement of domestic industry. The first is, when some particular sort of industry is necessary for the defence of the country. ..."
The usual defense-related payloads of Atlas rockets are definitely cases where the customer will not chase the cheapest launch to foreign spaceports but will rather use a launch that suits the customer's idea of national security. Taking a modern NRO payload to Russia is basically inviting Russians into Lockheed-Martin's factories for a detailed inspection of US spy satellites.