Well, in that case, Windows can't do any better. In order to defrag a filesystem, that requires free space to copy and move files around. If that space isn't there (because the HDD is nearly full), there isn't much you can do.
Of course with SSDs becoming more and more prevalent, this is becoming a non-issue anyway.