When you do something hastily you rush through it in a hurried manner. If you write an essay hastily, don't expect an A.
Haste is speed, so if you do something hastily, you're just doing it too fast. When a job should take time, like building a house, but it's done hastily, something often goes wrong. If you hastily leave the dinner table without explaining yourself, people will think you're rude.