The U.S. military said its attacks against Iran were in response to a threat to the Strait of Hormuz.