Hospitals are full of all kinds of hard-to-kill microorganisms. They really are not good places to stay after a major traumatic event (e.g. surgery) if you don't need the resources of the system; staying will only increase your chances of getting a life-threatening infection. When I get home from the hospital, I try to change out of my clothes as soon as possible for this very reason.
As for pain medication, well...one only needs to look at the enormous rise of opioid addiction and prescription medicine abuse in the USA to see that moderation of these very dangerous medications is in the patient's best interest.
The medical system is far from perfect, but don't operate on the assumption that the people working in the field are ignorant of the problems you're pointing out. There are many things we could be doing better, especially on the transparency and patient education side of things, but it's a huge industry and big ships turn slowly.