It sounds like you're at a point with your Beagle when you should be having him examined by your veterinarian in order to establish what his problems might be.
If he is truly overweight, that will complicate any other existing respiratory ailment. Vomiting phlegm, wheezing, and hacking could be representative of many different problems in a dog that age. A physical exam, listening to his chest, blood work, and probably some chest X-rays will be necessary in order to give you a better idea of what is going on.
NOTICE: The information provided on this site is not a substitute for professional medical advice,
diagnosis, or treatment. Never delay or disregard seeking professional medical advice from your
physician or other qualified health provider because of something you have read on Wellsphere.
If you have a medical emergency, call your doctor or 911 immediately.