Fair? No. Legal? Yes. There is no obligation for management to be polite, nice, fair, or respectful to employees (as long as they are not discriminating against a race, sex, religion, age over 40, or disability, etc.). And similarly, upper management could choose to side with the world's worst supervisor against the world's best employee. So they have a legal right to lay you off.
You can and should ask for something in exchange for signing a release (the no-fault clause)--you are potentially giving up rights, so they can pay for it. Even though it seems that they have a right to do what they did, they are obviously at least somewhat concerned (even if only that you'd bring an ultimately losing lawsuit that would still be expensive and distracting)--otherwise, they wouldn't need the release. You could try to negotiate for things like more severance; like paid up medial for a time; and/or good written recommendation letters in exchange for giving them a release.
Note that if the supervisor's inapproriate comments or other company behavior was discrmination or harassment against you because of your race, sex, religion, age, etc., you may have a work discrimiantion claim and/or lawsuit.