Vehicle diagnostics are far more involved than just plugging in a scan tool and having it pull up trouble codes. They only point you in the direction you need to go to get to the problem. For example, O2 sensor codes do not always mean the sensors are bad. Exhaust leaks can affect the signal the sensors generate because they have the potential to introduce more oxygen into the exhaust stream which throws off the sensors. Autozone code scanners won't tell you that though. So when a shop tells you they need to perform their own diagnostics, it's not because they want to charge more money. It's because it's part of the vehicle repair process.
Repair shops have a lot of overhead costs they need to cover before they can make a profit. Mortgage payments if they're still paying on the building, taxes, insurance costs, supplies, hazardous waste disposal fees, building and equipment maintenance, employee wages and benefits, and a few others. So they have to charge a lot of money for diagnostics and labor just to keep the doors open and the lights on. It's just a fact of life.