Use this letter to explain why you can't relocate and thus are resigning. It includes wording to suggest a remote working arrangement.
Dear Mr./Ms. Bossname,
Due to the corporate move, I am compelled to submit my resignation.
While I appreciate the opportunity to relocate, I cannot take advantage of the company's relocation program. My house is here, my spouse's job is here, and my kids' school is here. A move is not right for our family at this time.
I have no hard feelings and would prefer to stay on until the local office is closed. I would also like to suggest one more time that leaders consider allowing some employees to work remotely. I have many years of experience with the company and previously telecommuted in the same field. I can assure you that efficiency is not only possible but the norm in this day and age.