In politics, the organized faction always trumps the general interest. Say Faction A is 1% of the population. The faction wants to preserve a barrier to entry that costs every voter $100 and nets each faction member $10,000. The members of Faction A will be single issue voters over the barrier to entry. But to the rest of the public, the issue is lost in the noise. Average Joe does not even realize how much the barrier to entry costs him, because no interest group will fund ads to tell him. Thus the politician always supports the faction in order to prevent the 2% swing. ( I've spent time in both the state house and Congress, and this is exactly how the decision making process works).
The life cycle of any government policy ends up being the following: 1) Program is created to benefit the public good 2) The program inevitably directly benefits a small group - employees of the agency, contractors, etc. 3) The beneficiaries become dependent on the program. They organize in order to protect themselves politically. 4) In any policy battle where the interests of the beneficiaries collide with the public interest, the beneficiaries generally win. 5) As the beneficiaries win battles over time, the program ends up serving the beneficiaries at the expense of the public.
This is basically the life cycle of every program that has ever come out of Washington. The once mighty NASA now only exists to provide employment to NASA engineers. The school system exists mainly to provide employment to teachers. The AMA exists to erect barrier to entries to the medical profession. Etc, etc.
Your algorithm proposal is amusing because it is basically the same solution to the problem of corruption/factions that the progressives tried during the 20th century. The idea was that "scientific policy" based on algorithms and formulas, designed by academics and civil servants, could replace control by politicians. Needless to say, it was a miserable failure. A classic example of policy via algorithm is the creation of Nationally Recognized Statistical Rating Organization's who used algorithms to dictate which loans regulated funds were allowed to invest in. It did not take too long for Wall St. to figure out a way to structure the riskiest loans imaginable in ways that would pass through the algorithm. The rating agencies are a high profile example, but there are hundreds of other similar failures. In practice "scientific public policy" ends up being the worst of both worlds. It combines the downsides of algorithms (lack of intervening personal judgment when the algorithm gets gamed) with the downsides of politics (corruption/factional power struggles).