There are several good reasons to apply the change retroactively, which I think make an overwhelming case when taken together:
- The previous change, from awarding 10 points per question upvote to awarding 5, applied retroactively. Consistency with that precedent suggests this one should apply retroactively, too.
- Besides being an incentive, part of the purpose of rep is to indicate the value of a user's contributions. But, all else held equal, questions asked before this change weren't any less valuable than ones asked today. It would be weird if the rep rewards suggested otherwise.
- Yet another part of the purpose of rep is to determine who is deserving of the privileges that are granted at various rep thresholds. Here, too, it's illogical for the change not to be retroactive. If it's not retroactive, then we end up concluding that somebody who earned 300 question upvotes in 2018 cannot be trusted with close-vote powers, but somebody who earns 300 question upvotes in 2020 can be, which doesn't make sense.
- Implementing it retroactively is presumably the simplest possible thing for the devs to implement: they just tweak the value of a question upvote, then run the historical reputation recalculation script that already exists. Avoiding the retroactive application would require new logic, which means spending dev time and introduces more scope for bugs.
- If the change doesn't apply retroactively, then people's rep histories will sometimes show +5 for an upvote and sometimes +10. That'll be confusing to new users in the future who are trying to understand the history.
- If the change doesn't apply retroactively, then the staff would need to decide how the system would handle retraction of upvotes. If I upvoted a question before the change and then I retract it after, how much rep does the user lose? If I then subsequently re-upvote it, how much rep does the user gain? Every possible answer here is unsatisfactory in some way:
- If retracting results in −10 rep, then when a user who upvoted my question in the past gets deleted and their votes vanish, I get punished on net for the fact that they found my question helpful. This is unfair.
- If retracting results in −5 rep, but subsequent re-voting results in +10 rep, then I can further reward people I upvoted in the past by retracting and restoring my vote. This is a perverse incentive for me to engage in an annoying behaviour that doesn't add value to the site, especially given that I may need to make a dummy edit in order to retract my vote if it's already locked in.
- If retracting results in −5 rep, but subsequently re-voting only results in +5 rep again, then the site needs to check whether I previously voted in order to figure out how much rep to award someone when I upvote their post, which is annoying extra complexity.
As for your legal analogy...
Ex post facto law principle (a law that retroactively changes the legal consequences (or status) of actions that were committed). In SE's case, there is no crime involved, but following the principle, you generally do not change the consequences retroactively. An interesting fact is that "American jurisdictions generally prohibit ex post facto laws".
... I note that this isn't generally held to forbid legal changes that alter the value of a person's property, and thus their wealth. If I invest all my money in a factory that uses a chemical process that the government subsequently bans, thus rendering my factory worthless, then that's too bad for me—I simply lose all my wealth. Likewise, if I invest all my money in a factory and then the government decides to start subsidising consumers' purchases of the thing my factory makes, driving up demand and profits, then—lucky me!—I become rich. Both these things involve rule changes that immediately and dramatically alter my wealth, and both are considered acceptable in real-life politics and law—including in America.
In the same spirit, it doesn't seem like an "ex post facto law" if the rep-value of my existing posts gets altered by a rule change here.
In conclusion, I'm not convinced there's a good principled reason why this change mustn't be retroactive, and I see several good reasons for it to be. I think making it retroactive is the right call.