Doctors don't just "go to medical school". They are licensed professionals who are required to complete extensive theoretical, practical, and professional education in a system designed and governed by the state and relevant professional bodies. They take an oath, and they are personally responsible for their mistakes and the consequences of those mistakes. They are required to conform to a rigorous system of ethics, and they can lose their license and their livelihood if they do not.
All of these facts are also true of "real engineers", and it's why coders are not "real engineers", regardless of whether they have a CS degree.