I've always wondered about this too. What happens when precedent is set either by faulty cases or people with agendas?
TL;DR: Precedent is binding to court where it was set and "below". To overrule it, you generally must appeal until you reach the level above where it was set. IANAL.