It is illegal in some places and legal in others. Please don't try to force your laws or your morals on the rest of the internet. IMEI changing has a very legitimate reason - some programs lock themselves to IMEI. If your device is broken and replaced as part of warranty service, or is lost and you decide to get a new one, you suddenly can't use the programs you bought. You find yourself at the mercy of companies which might accept this change and might not. Changing the IMEI to the original one is much easier.