The Rema (695:2) writes that it is proper to engage in the study of Torah prior to starting the Purim seudah. An allusion to this custom can be found in the Megillah, which states: ליהודים היתה אורה ושמחה – “The Jews had light and gladness ...” (Esther 8:16). Chazal tell us, אורה זו תורה, that is, the word אורה in this pasuk is referring to Torah. The Rema expounds this pasuk as referring to the practice of kindling the light of Torah before celebrating the simcha of a festive meal.
In Darchei Moshe the Rema elaborates on the reason for the custom, writing that engaging in the study of Torah before the seudah provides spiritual protection. It ensures that nothing inappropriate or unseemly will transpire during the meal.
The Rema’s source or this custom is somewhat curious. The pasuk does seem to imply one should study Torah Purim, but where does the Rema get it from that it should be immediately prior to the seudah?