Literally every intelligence service does this, they're called "assets"[1]. Right and wrong isn't as black and white as you may think.
Just because most / all intelligence agencies do something doesn't mean it's okay. It's unambiguously wrong.
It is roughly equivalent to if the CIA did this to Black Americans pre-1965.