Stash paper cash in your safe and sure, you lose purchasing power. Use fiat money the way it's designed to be used, instead of using it like gold coins, and it works better.
If currency doesn't devalue then stuffing it under a mattress looks like a reasonable alternative to investing. If we hit deflation you can receive gains for "free" and borrowed money becomes more expensive over time. Neither of which our economic system is setup to handle.
We punish people who hoard cash by devaluing it thus encouraging them to put the money to work.
So it's not that "2% is good", but more that "2% is the best buffer we've decided above the <0% super scary threshold"
It's even more interesting to contrast this from 1971 onward. 1971 is when Bretton Woods ended and the government was given a free hand to start 'printing money' so to speak, and inflation became the new policy. Since then the CPI has increased by more than 800 points, 1600% more than our baseline. And it's only increasing faster now - to the point that these numbers I'm giving are already rather outdated.
[1] - https://www.minneapolisfed.org/about-us/monetary-policy/infl...
The broad idea is you want a number low enough that people don't price inflation expectations into day-to-day pricing but not so low that a hiccup causes deflation.
The empirical evidence around inflation persistence is a bit all over the place, but broadly suggests people start daily indexing between 2 and 5%. When that starts to happen, restraining inflation without causing a depression becomes incredibly hard, because people will actively countermand policy moves.
An offhand remark made by New Zealand's Finance Minister, Roger Douglas, during a 1988 television interview.
But the bigger issue is that inflation is generally distributed much more evenly than wage increases. Very few employers offer a COLA that is automatic, so wages almost always trail inflationary pressure.