Personally, I think that, if your site accepts discount codes, you should always show the field where the customer is supposed to enter them, for a couple of reasons:
- Consistent experience - even if there are no valid codes to enter, by showing it every time, a customer will know where to enter one when they have it.
- Awareness - by showing the field, you are passing the information to the customer that you do accept discount codes at your site. A customer who sees no field for discount codes may assume that you don't take them and search for another site where they might be able to get a discount.
Now, that being said, I also think there is room for improvement, in regards to this specific user experience (like you suggested, it can be frustrating to a customer to go off looking for a coupon and not find one). Personally, I wouldn't mind seeing a message by the field, indicating that there are no currently valid codes (maybe include in it a link to the "coupon sign-up process", that Mervin mentioned) . . . potentially even have the field disabled, as well. But, if discount codes are something that your site supports, I think it's pretty important that the customer can see that field, in the same place, every time that they go through the checkout process.