But how could it be avoided? The police don't operate on 'guilty' and 'innocent', but on 'suspect' - even if they do everything right, they'll occasionally arrest someone that will later turn out to be innocent. If they're responding to an emergency, they simply don't have time to determine guilt with much accuracy, and are just focusing on protecting possible victims. And if they're arresting someone being prosecuted for some crime, well it's unavoidable that occasionally someone won't be found guilty for what they stood trial for - that's the whole point of a trial.
However, I agree that if that should happen, the detained should be compensated for the harm they suffered, even if the police (and prosecutors!) acted reasonably.
I should clarify that I don't mean to imply the US police and public prosecutors meet these reasonablenes criteria - from what I hear, the deck is stacked heavily against anyone being prosecuted for a felony, guilty or not.