Disclaimer: I'm a doctor.
It may be different where you are from, but patients are usually the ones who want a script for something and not to be told to put away their devices, stay away from coffee and alcohol, etc.
Also, there's a difference between addiction and becoming dependent on taking a substance, which seems to be a common misunderstanding in this thread.
The more I hear about healthcare from the inside, the more I realize it's a game of "work on the worst problem, ignore the rest". There's limited time in patient visits, and patients have limited motivation, so you really have to prioritize what to fix. If you tell the patient to fix all the things, the will fix none of them.
Worse, patient education is hard work. Patients don't listen, ignore advice, stop lifestyle changes as soon as it gets hard. So you focus on one or two of the worst offenders; you convince them cigs are going to put them in an early grave and they should cut back to half a pack a day. Maybe drop the soda to two liters a day. The rest of their problems you have to ignore until later. That's often when meds come into play because they can help bridge the gap while you work on their lifestyle issues.
Oh, and all of that happens in 15 minute visits every other month.
There are certainly bad doctors out there over-prescribing all sorts of things, but from what I've seen, it's more a matter of prioritizing what to spend your precious 15 minutes on and going from there. Doctors and other medical professionals are in an impossible situation most of the time.
Edit: for clarity, this is an American healthcare perspective.
I'm guessing you're American since you're assuming everywhere has the same crisis you do. From what I've read here (on Hacker News), you have plenty of systemic problems. I doubt blaming doctors is going to be the most useful course of action. But then, I don't really know. Perhaps all doctors in your country deliberately do things that are against patients' best-interests, and would continue to do so if patients actually wanted the best thing for them. Do your doctors really not suggest good diet and exercise as treatments for type 2 diabetes? I'd be very surprised if they don't.
Edit for clarification.