The US president emphasized that the country was spending "trillions of dollars" on an alliance that did not support Washington's actions toward Iran