As others have done a good job at explaining, asking someone to resign in lieu of termination is generally legal. In your particular case, though, it's more tricky than that. Down in the comments, you said:
no, I'm already laid off. The paychecks have stopped and the
insurance is gone
Since the separation event has already happened, an attempt to change the reason for it retroactively might not hold water. This gets into some tricky and possibly locale-specific legal details, so it's probably best to consult an employment lawyer.
Also in the comments, you clarify:
there exist no paper saying that I am resigning of my own free will.
The document only states that I must tell anyone who asks that I
resigned. I realize that this seems like a weird distinction, but
this is the language in the document.
This changes the situation quite a bit. They're not changing the reason for your separation, they're simply asking you to respond to questions about your separation in a particular way. This sort of thing is legal in general (it's a bit like an NDA), but there's an important factor to keep in mind. You do not have to abide by this agreement in any situation where lying about your reason for separation would be illegal. Falsifying information on an application for unemployment benefits would be criminal fraud, which their contract cannot require you to commit. Similarly, if you are questioned by a government agent investigating the company or are subpoenaed to testify in a lawsuit, lying would be illegal and the contract cannot force you to do so. Lying when questioned during a job interview is tricky because the contract could be enforceable here, but lying in an interview is usually cause for termination should the truth be discovered.
This is important to keep in mind, because there are several things to be aware of here. A federal law called the WARN Act places requirements on any employer who closes a plant or lays off more than a certain number of people. Several states have their own layoff notice laws as well. If your employer didn't comply with these rules, they could be trying to avoid trouble by making enough terminations look like resignations such that they fall below the threshold. That could be illegal in and of itself. Also, the Civil Rights Act, the Americans With Disabilities Act, the Age Discrimination In Employment Act, and others protect workers from layoffs as a form of discrimination. If your employer received a loan under the Paycheck Protection Plan of 2020, they have certain obligations towards laid-off employees (but not those who resigned) that could impact how much of the loan they have to pay back. The severance contract cannot prohibit you from cooperating with an investigation into a violation of any of these types of laws. The clause requiring you to lie about the reason for leaving does not in and of itself prevent you from filing a complaint with the Department of Labor if you believe that the company violated one of these laws. Some (not all) severance contracts include an agreement not to bring a civil suit against the company for such violations. A contract cannot, however, bar you from making a good-faith report of a criminal violation of law to the appropriate authorities.
In my mind, doing this after the fact makes it look like the company realized they messed up and are trying to CYA. They would have to be offering me a exponentially better severance package before I'd even consider helping them out after they laid me off. If you have any reason to believe they might be doing this to cover up any level of wrongdoing, I strongly recommend that you file a (normally anonymous) complaint with the Department of Labor.