Moral dilemma in unwittingly being paid to complete a student's work
I think you should take the money, try to retain as much of my copyrights as possible (the law may help you do this implicitly rather than explicitly, which may be helpful), and refrain from doing anything else until after the student misuses your work.
Why? Consider that:

Plagiarism is not a crime.
Copyright violation is a crime.
Neither has occurred yet.
You have done the work in good faith.
You are not responsible for preventing others from plagiarizing your work.

Refunding him and keeping the work would be unfair to you because you have already done the work. You have every right to keep the money for the work you have done.
Refunding him and keeping the work would be unfair to him too, since he has every right to obtain the work from you that he has paid you for and waited for. Even if you refund his money, you can't refund the time that he has spent waiting for you to do the work, so you would arguably be liable for damages too.
If your work is actually plagiarized, then you will have a basis for complaining academically and/or legally, and it will be more difficult for your client to view you as a &quot;snitch&quot;, etc. if he violates your copyright.
If you let his institution know before the deed occurs, then I'd argue you're doing something morally wrong: you're getting him into trouble for an act that he has not even committed yet. (This might be fine for dangerous actions, but this isn't one.)

Clarification:
I should clarify that my answer is only intended for a &quot;generic&quot; freelancer, not someone who has something else at stake too.  For example, if you yourself were e.g. a professor/graduate student/public figure/etc., then you could earn yourself a bad reputation among your colleagues by giving him the work even if most other people would consider what you do to be entirely ethical/moral/righteous. In that case, the wisest career move for you may not be the same thing as what a typical freelancer might or should do, so keep in mind I'm not addressing such situations.