Firstly, it is not compulsory – it is just that companies are allowed to do this.
The reason companies are likely to want to do it is that the revaluation surplus is a capital reserve and cannot therefore be distributed as dividend. By transferring some of it to retained earnings each year means that it can be distributed (because retained earnings is a revenue reserve).