But these were. You're creating a false dichotomy between cops who violate people's rights and cops who think that they're doing the right thing.
To be fair, even those of that school like believe "they [are] doing the right thing and attempting to bring a bad guy to justice."
You mean, just like TSA officers who believe that X-raying everyone who boards a plane is the right thing if we want to catch these darn terrorists?
Beyond that, the ends rarely justify the means, even legally. There are supposed to be limits to how the police find stuff out. See 4th Amendment. Traditional sense of fair play, decency, etc.
The ends often justifies the means, even legally, its just that the cases where the proposition that the means used is justified by the ends served isn't controversial don't get any attention, in much the same way that you never see news stories of the form "Today, the following areas had no major earthquakes..."
It's not a popular sentiment on HN, but not all police officers are part of the shoot / oppress first, ask questions later school of policing.