Is it ethical to withdraw a paper after acceptance in order to resubmit to a better journal? I think the title asks the question, but once again in more words:

Suppose you submit a paper to a journal and it is accepted by the journal.  By this I mean that the journal tells you that they have decided to publish your paper but you have not submitted or examined final proofs and -- especially -- not signed any paperwork allowing the journal to publish the paper.  

I wonder how people feel about the ethics of deciding not to go through with the publication because you now feel that the paper could be published in a better journal?  This could happen either because of outside feedback you received in the meantime or because of feedback from the referees/editors of the journal itself.  (Added: In case this was not clear, I am assuming that upon submission one was seeking to publish in that journal conditional on not learning that one has "shot way too low".)  

As far as I can see, it is absolutely legal to do this, so I am not interested in the legality of it, but rather its ethics and ramifications as an academic practice.  I also think I will get better answers if I do not telegraph my own feelings about this; I will be happy to document them later on.  Let me just say (i) this is a hypothetical question, but (ii) based on my own experience it is not ridiculous that it might be in the interest of the author to engage in this practice, if it happened to be kosher to all parties involved.

Note: I had previously asked a related question, at the time wondering whether it would be better asked separately.  Based on the way things have gone thus far, I now think it is better to post this followup question separately (not necessarily right away).
It is not ethical to withdraw a paper that has been accepted. Journals, editors, and reviewers invest time in the publication process. To withdraw a paper after it has entered this process is a waste of their time. While the legal ramifications of is behaviour are probably limited, it will result in bad feelings.

As for not having the money to publish. Assuming the journal fees are available prior to submission, and reputable journals make their fees known, then if you don't have the money, then you don't get to submit. If they have a paid expedited service and you are worried about the back log, then ask up front. The only case that it might be acceptable is if he review process drags on for so long that your funding ends.