Congratulations, you've encountered the project management triangle, often summarised as "Good"good, fast, cheap: choose two" for very good reasons.
You're working for a consultancy, also known as a body shop because they sell the time (bodies) of developers like you to clients. The two points of the triangle that a consultancy implicitly chooses are fast and cheap, because that's what their clients choose.
In other words, if you work at a consultancy, you'll never be permitted to deliver work that is high quality, because that is against their business model. If you try to deliver high-quality work, you'll find yourself railroaded to a dead-end role like support, because you become a liability to the company by taking more time than a dev who doesn't care about quality.
This is never going to change as long as you work for that company (or indeed, any consultancy). Trust me - I worked at one for 8 years (or about 5 years too long).
Therefore, the only answer to your conundrum is "find another job" - difficult in this economic climate, but not impossible. Especially if you can demonstrate you care about code quality - there are development houses run by people who care about that sort of thing. Just don't ever work for a consultancy again.
Really, the question you should be asking yourself is: how long can you afford to stay in a job where you aren't getting the opportunity to practice and learn how do software right? How long can you afford to stay in a job that is actively wearing you down? How long can you afford to stay in a job that will happily fire you at a moment's notice if they can find someone who is more "productive" than you in terms of lines of code emitted?
And be careful if (hopefully when) you do decide to leave. The company will do a lot to try to keep you, because they do understand that a dev who gives a s**t is more useful than a fungible brain-dead code-generating human machine - but they will never be able to deliver on the promises they will make to you regarding improving quality. Again, I've had this experience.