US President Donald Trump criticised NATO allies for refusing to back the United States during its conflict with Iran.