Well, first of all, I don't have XP and thus cannot check how the defrag is implemented there, but there are various reasons why it might do that. First of all, MSHTML is also a development platform, not just html renderer. Writing UIs is tough job, but every monkey can do webpages. As of such, html is good for user interfaces.
Second, the defragmenter isn't written by Microsoft, it's by a third party who sells a better defragmenter (Diskeeper), and apparently sold a crappy version of the defragmenter to microsoft. Yay. So, it's not entirely microsoft's fault if the defrag stops working when you remove something which you expect wouldn't affect things. It's a design choice by Executive Software.