Why is it illegal to change temperature of water heater?
You can do this, but not as completely as one'd want to

The approach you describe (running a tank full-hot and then downmixing it to a scald-safe temperature using an ASSE 1017 central thermostatic valve) is indeed permitted by the Codes, although it does not negate the need to provide scald-safe fixture valves at showers and baths.

However, one drawback of this approach is that it limits the protection from Legionella growth provided to the hot-water piping system.  In most applications we consider here, that's not a huge drawback; however, it does mean that care should be taken to avoid "dead legs" of hot water plumbing, as those are common hangouts for pesky Legionellae.

The ultimate system uses an anti-scald mixing valve feeding directly into an anti-scald fixture at baths and showers, and an anti-scald mixing valve at bathroom (and perhaps kitchen) sinks as well, allowing untempered water to be fed to clothes washers and dishwashers to minimize the need for booster heating.  This is more commonly done in the more complex commercial/institutional plumbing environment, but is theoretically doable for residential work as well, although the standards for mixing valves are in a bit of flux at the moment.