Under the Americans with Disabilities Act, employers must "reasonable accommodate" employees with disabilities. Reasonable accommodations may include a modification in job description or a change in job. However, employers are only required to offer accommodations that do not impose "undue hardship" on the company. Accommodations which impose undue hardship are not, by definition, "reasonable."
So the question here is whether your employer could have continued to reasonably accommodate you rather than taking you off work. However, if you were unable to perform essential functions of the position, and if there was no way to accommodate you in a manner that allowed you to perform those functions and no other available position that they could move you into, it is likely that they have no further duty to accommodate you. Simply put, there is nothing more they can reasonably do that would enable you to perform the essential requirements of your position.
You could file a complaint with the EEOC and have them investigate whether your employer could have continued to reasonably accommodate you. This is a protected activity, meaning your employer cannot retaliate against you for it.
In the mean time, it would be prudent to apply for FMLA as that is what will protect your job while you are off work. You don't need to put a "reason" on the FMLA papers, you just need your doctor to certify that you are suffering from a serious health condition.
I hope this addresses your concerns. If I can clarify anything at all for you, please do not hesitate to ask. It is my pleasure to assist you further if necessary....