That's a legal principle which exists because of the incredibly high bar we want our governments to cross before they deprive people of their liberties. Individual citizens can believe whatever they want to believe.
Im pretty sure it was implemented because of the amount of mob justice that was going on during the period of the salem witch trials.
You are absolutely correct, but many people like to forget this cause obviously mob justice only happens to bad people. They tend to hold this position right until the mob stands in front of their own door.
pretty sure it was implemented a millennium or two before that
Its generaly attributed to Sir William Garrow a British barrister who made the notion that people should be innocent until proven guilty in trial in 1791. before that the justice system was guilty until proven innocent, so the salem witch trials in 1692 would absolutely be under guilty until proven innocent and unfair trials like that are what changed people mind to mob justice where guilt is assumed not proven.