Yes, because they aren't yet trained to practice medicine. Residency is where they are trained to practice medicine.
> Do they require so much supervision?
Yes, both by practicality and by law.
> If residents are just cheaper doctors
They're not "just" cheaper doctors
> then hospitals would optimize for a high resident:attending ratio.
They tried. Patients died. Now we cap both the number of hours they can work per week (80 hours/week) and the resident:attending ration.