It's possible that installing malware on a machine could be legal if the police have a warrant to wiretap that specific machine. However, in this case, they indiscriminately pushed malware to thousands of users on that site, many of whom were probably not doing anything illegal. So how does this not violate the Fourth Amendment?
The Fourth Amendment says: "No Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized."[1]
The Fourth Amendment says: "No Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized."[1]
[1] https://en.wikipedia.org/wiki/Fourth_Amendment_to_the_United...