It depends on what the terms and conditions are. If the terms specify that you need to pay the fee within a certain period of time, then they can. If the terms don't specify this but give the editor some discretion on certain issues, the they might also do this.
The question that you should ask yourself however is whether it matters whether they are allowed to do this. You might be in the right, but would you really be willing to go to court over this?
What you need to do is to convince them that they should publish your article. One way to do this is to apologize to the editor for not paying the fee sooner, and ask them whether it is possible to re-submit to this journal. Your personal circumstances are neither here nor there. You can at most mention that due to personal circumstances you did not pay the fee at the time and leave it at that. And if it is not possible, then submit the paper to another journal. What happened in the past is now in the past and is irrelevant for all practical purposes. You might have an in with this journal, but if not, then you're probably better off accepting it and moving on to a different journal.