I think the amount of gold you accumulate should be how many experience points you have. And when you reach milestones you're allowed to level up.

But any money you spend keeps you further away from your next level milestone. So you can save your gold to get to your next level or spend portions of it on things like magic weapons that will be useful in combat.

That's how it used to work a long time ago, back in the days of Advanced Dungeons and Dragons. Good times.