I am sorry but I would have to disagree with most of the answers to this question, except for the top one.
The primary value of software is that it is flexible.
I don't think you should rewrite other people's code without just cause. If you have to change a module for any reason to implement your feature, you are now, for better or for worse, the owner of that module. Change it, rewrite some of it, rewrite all of it.
Never produce low quality in terms of flexibility ever. There is no such thing as throw away anything in software. If the client says its temporary and that they wont need it after a certain date, and they don't care about quality, either say "to bad" or get in writing that the code will not be altered by you or any other programmer once it is deployed to production, or you have the right to sue them.
The poorest assumption I see in some of these answers is that some clean code somehow reduces the speed of development. For any project of any substance (greater than 6 hours of work) clean code speeds development in the long term (anything greater than a week). I have seen it time and time and time again.
Poor quality code is just disrespectful to the profession and your coworkers. Sorry but true.
So no to poor quality, in terms of flexibility, ever!