Not all code is created equal.
Great code should exhibit intentionality, clarity, skill, and direction. Just like great writing, code varies in quality and consistency.
Think of how the APA and MLA guidelines set standards for research papers — when it comes to code, the developer world does the same, setting standards to regulate how code is written. To some extent, code is regulated by frameworks (e.g. CodeIgniter, Cake, Symphony), platforms (e.g. Magento, WordPress, Joomla!) or organizations like the World Wide Web Consortium (W3C).
It is important to not only write code that works, but to write code that works well and is sustainable. Just because an application functions now doesn’t mean it is built correctly or will function well in the future as things change.
All cars, buildings and bridges are not created equal and neither are websites, applications or API’s.