The ones who have devised this unlocker are licensiung it to prevent others from re-selling it for money. They are not charging for this 'license' unless you use it on numerous phones, in other words to resell.
As far as the legality I cannot say for sure. HTC doesn't publicly condone this but they don't do anything about it either. So I guess what I'm trying to say is- don't worry about it