The method to put the code may be different in wordpress. There's nothing wrong with code.
Only you have to use it in particular method , I think in wordpress its just like how you put the image link like in this forum.
Check this :
How can I post buttons and images links in my sidebar?
Click “Blogroll” from your Dashboard and then “Add Link”. If you scroll down, there’s a box for you to enter an image url. Fill that in, and an image will be displayed instead of the link text.
OR
To add badges to your sidebar you need to use a text widget. Check out the examples, you'll understand .
<a href=”http://faq.wordpress.com/wp-admin/the-site-to-link-to”><img src=”http://faq.wordpress.com/wp-admin/where-the-badge-is” /></a>
Or if you wanted to link to Digg:
<a href=”http://digg.com”><img src=”http://faq.files.wordpress.com/2006/07/digg.gif” alt=”Digg” /></a>