What can I do if my advisor wants me to keep working, even while I'm on medical leave for severe depression?
There is only one suitable course of action I recommend, as an advisor and a physician. Stop with anything that has a potentially detrimentally effect on your health and focus on your treatment (thus if you believe so also your MSc commitments). 

Indeed, your work is likely contributing to your depressive symptoms (irrespective of the differential diagnosis between burnout and depression; e.g. Bianchi et al, Soc Psych Psych Epidemiol 2015). 

Much more importantly, if you do not treat yourself now in the best possible fashion you might fail the treatment and even face substantial complications early or later, even life-threatening ones (e.g. Mann, New Engl J Med 2005). 

I would definitely inform your physician that your advisor's attitude is likely a contributory factor to your condition. 

Finally, notify any oversight committee at your institution, as individual or organizational issues impacting on your depressive symptoms could and probably should be addressed thoroughly (e.g. Theorell et al, BMC Public Health 2015).