Governments can generally do what they want when it comes to foreign nationals, provided they aren't breaking any international treaties. And regardless of the spying involved in this case, the US is free to kick out anybody on a visa that it doesn't like at any time for any reason. It's not nice but that's how it is.
Makes sense, and it would taint any evidence discovered using that information... provided you could prove it. Unfortunately, doesn't stop them from playing visa games.