It is considered unethical but I do not believe it is illegal for a doctor to "termimate" a patient in this manner. I would ask the doctor who "terminated" you as his patient to put his reasons in writing. He will not want to do this. But by asking him to state his reasons, it may be a way for you to get him to continue your care until you can be seen by another Pain Management doctor.
He may have been "flagged" by the DEA or is afraid he might be. He may be eliminating patients from his practice who are higher doses of pain medication to protect himself from a DEA inspection.
Sadly, pain management in the USA is well behind that of other countries due to doctors fear of being questioned and or/charged and fined by the DEA. This fear by the doctors causes patients to live in pain unnecessarily. It is very sad.