That's by design.

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.

One side says this design is necessary to sustain growth. The other says it's unfair because the gains from the growth are unevenly distributed. Neither is wrong.