but is it necessary for a pilot to have a Masters Degree?
For a PPL, any level of education is OK, so long as you can pass the exams. For professional, it's not necessary for a pilot to have a degree, or even A levels! The only maths you need to be a pilot is your 3 times table! ATPL maths is GCSE level - at best, and all the aerodynamics and systems syllabus is read and learn the question answers stuff. You don't have to understand any of it. I joined the RAF with nearly the bare minimum of 5 O levels including maths and English. That's as much as you need - maybe more!
As an Aerospace Engineering graduate, you are vastly over qualified. A Masters will make you even more so. If you have a passion to fly, then that will probably get you through. But the mind numbing boredom of it will probably make you wish you hadn't spent all that money training. My advice is to do the masters and decide then. You will have much better career choices.