I agree he should have self-grounded, but the legality seems a bit squishy.. Under FAR 61.23, a SP must...
(iv) Not know or have reason to know of any medical condition that would make that person unable to operate a light-sport aircraft in a safe manner.
For SPs, there isn't a list of prohibitions. If there were, MANY of the PPs flying under SP regs would be grounded. The FAA knows this and seems content to leave it up to the pilot's discretion. (Basic Med operates in a similar fashion, thought it does get a state licensed physician involved.)
Certainly Bernath had medical conditions that might make him unable to fly safely. Whether the conditions did so in fact is up to the pilot's judgement. His particular conditions and meds may have even impaired that judgement. It seems to me he would be equally impaired as a driver, but AFAIK he still had a driver's license. Had he surrendered his driver's license it would clearly be illegal for him to fly.