I would never do an MPA (or MBA) right after undergrad. It’s great marketing for the school to keep you an extra year - and your income.
What a waste of a degree from a monetary POV.
Work a few years and then go back.
btw - we just hired an engineer with MBA as a specialist - four years out of school. Not sure what we are paying him - but a specialist level makes less than my son will make coming out with an engineering degree. I just don’t get those who go straight through - you are all giving up the ability to pivot and grow your income later.
Don’t forget loans have interest and fees - so you are not borrowing $40K and actually getting $40K - more like $38.5K or so. And interest then adds over time.