US President Donald Trump called the move "a favour" to countries that "don't have the courage or will to do this work themselves".