Defense Medal:
You get a defense Medal when your castle is fully protected, meaning not a single enemy can get in your castle
Wisdom Medal:
You get a defense Medal if your units are placed at the maximum damage they can inflict.
Wealth Medal:
You get a wealth medal if you have still many coins remaining when a level is finished, however the amount depends on the difficulty of the level.