It is not that "WE MUST optimize intermediate code". If possible all optimizations must be done on intermediate code so that the same implementation for the optimizations can be used for different front and back ends.
Say you have 5 front ends and 6 back ends. If we optimize at the front end, we need 5 implementation and if we optimize at the back end we need 6 implementations. But if we optimize at the intermediate level, we need JUST 1 implementation.
(There will always be backend dependent optimizations though which can never be avoided)