There are lots of reasons why some scopes are better then others. Things like lens coatings, internals, tube construction, etc.... So lets talk about some of these.
Lens Coatings
All lens coatings ARE NOT the same. Each company has its own proprietary coatings and some are awful while others are spectacular. For example BSAs optics suck. The quality of the glass or coatings has never been very good. Where as Leupold coatings are much better and they make the glass pretty good. Then you have companies such as Zeiss and Schmidt & Bender who light transmission and resolution is mind blowing.
It all has to do with the lens coatings. Glass by its very nature is reflective and tends to act more like a mirror. Thus companies fine grind and polish the glass then put there coatings on them to combat the reflective properties of glass. At the end of the day it shows which companies did there homework and which did not.
Internals
Internal construction of scopes varies greatly with brand and model. Prime examples of this are the differences between the Sightron SI line and their SIII line or the Leupold Rifleman line and the Mark 4 line. The SI and Rifleman line are the ecnomey lines and the internals are put together with cost being the motivating factor. On the other hand the SIII and Mark 4 line of scopes are markets towards high end market where people are willing to pay more for the products but also expect a lot more. Thus the internals are built with repeatablity and durability as the primary goal.
Tube construction
Not all scope tubes are constructed the same. Most tubes today are one peice tubes but not all. Also the sidewalls are constructed to different thicknesses for different manufacters. For example Nightforce tubes are of thicker construction then Bushnell. And it shows in weight and the amount of abuse the scope can take.
These three factors are the lions share of what makes a scope however it is not all of it. Things like Nitrogen filled air purged and external design have a bearing on quality also. Also remember that price doesn't nessarily reflect quality. Cheaper scopes can be found that work well, examples would be Falcon optics, Busnell Elite series, Super Snipers, etc..., but you generall get what you pay for.