Accessibility is generally an afterthought. I don't have hard evidence to back this up except for the all of the clients I've worked for but talk to anyone in the accessibility space and you will hear that phrase eventually. This fact is saddening to be sure, but to me it's not all that surprising.
Many in the web accessibility scene will state that web accessibility needs to be baked into the foundation of a website. While this is the obvious end-goal, the current state of the web unequivocally shows that this is not the case. Web accessibility is simply not needed to conduct a financially successful website, a pill that can be hard to swallow. When creating a website, at least traditionally, the parts of the whole are planned to be added in layers. In university I remember being taught to create the HTML layer first, then add layers of css on top. Specifically create the mobile css, then work your way up in width and height as soon as the site looks sub-optimal - one CSS layer overwriting the previous.
The HTML base layer is the foundation that web accessibility needs to be added to from the start, but it too goes through layering of changes. These HTML changes usually go hand in hand with CSS layers: add classes here, remove a div there, sometimes rearranging the tags entirely to better fit a different solution. The underlying principal remains: create bare-bones and progressively enhance the code until there is a working product.
This process of improving the Minimum Viable Product is found in every programming (and I dare say, engineering) domain. Start with the basics and work your way up, adding features and improving the product one step at a time. You can't add to something that doesn't have a foundation as it doesn't work.
It's no wonder to me then that web accessibility is see as an afterthought. For management it's not strictly needed to reach the 80% of customers they want and for programmers it is literally just another layer to be added onto the HTML and CSS stack. For both, the problem is considered similar to not supporting a certain device or viewport. What's the difference in not supporting pre-iPhone 6 users compared to not supporting web-accessibility? Both, for example, might make up 2% of the user base. The difference of course is that those pre-iPhone 6 users can use different device to access the site without issue, those that rely on accessibility are locked out for effectively forever. Communicating that accessibility cannot be seen as just another device is hard. Changing mindsets is hard.
Unfortunately, the most successful way to persuade companies is to sue them. Even then, some companies must actually lose ground in the courts before actually deciding (or being legally forced) to make a change. Luckily, changing the conversation to be financially focused in the terms of lost revenue carries a similar sense of urgency and blatant "why aren't we doing this" mentality without any of the threatening implications. This doesn't always work of course, especially if there is another set of users being left out that have higher website usage. For the most part though this method is great for persuading managers, but what is an effective way of altering programmers?
Well... I have not yet found a consistent solution. Sometimes having a clear cut requirements list is the best way to go, alongside adding in webapps with clear-cut pass/fail feedback (like whocanuse.com or lighthouse). I'm unsure if this works due to being actionable or if it just irks the defensive part that every programmer has when something says that your work has failed. Some do not care at all about the metrics, to these programmers I challenge them to use only the keyboard to navigate their website. Such a task generally frustrates them enough to at least start thinking about accessibility.
Those that aren't fiscally motivated, ashamed of their work failing to meet a standard or eager to learn about different fields of knowledge are quite hard convince. If you have found a way to teach those that don't want to learn please let me know. Most likely those people are set in their ways until they get sued once or twice. Luckily most successful programmers/managers/companies do not fit that mold.