Praise be to Allah.
If the programming work is limited to that which is permissible, and has nothing to do with the haraam sites such as sites for selling or manufacturing alcohol, then there is nothing wrong with staying in this job. It comes under the heading of payment for permissible work done for one who is committing a haraam action, like working for one who deals in riba or drinks alcohol and so on. It is well known that the basic principle is that this interaction is permissible, so long as it is not helping in doing the haraam action. Some of the companions of the Prophet (peace and blessings of Allaah be upon him) worked for the Jews, even though it was well known that they dealt in riba and consumed haraam wealth.
But it is makrooh to deal with those whose wealth is mixed, and you have done well to leave this company. We ask Allaah to compensate you with something better.
If the work in programming and the work in designing websites for advertising alcohol or other haraam things is mixed, then it becomes obligatory for you to leave this job, because it is not permissible to deal directly with haraam things or help with them.
See question no. 31781.
And Allaah knows best.