It's also been an ally of Iran. Qatar is not neutral in that it stays distant from both sides, it is neutral in that it attempts to maintain good relations with both sides.
Iran has attacked the US base in Qatar before. When they did so in 2025, Iran's Supreme National Security Council issued a statement: "this action does not pose any threat to the friendly and brotherly country, Qatar, and its noble people, and the Islamic Republic of Iran remains committed to maintaining and continuing warm and historic relations with Qatar".
This time Iran attacked Qatar itself, including the Ras Laffan gas facility and Hamad International Airport.
Qatar has never been allied with Iran. It has had economic partnerships, especially around the oil fields that Israel blew up, but that is not an alliance. Iran does not have military bases in Qatar.
Why would Iran need a base in Qatar? It's right next door.
Iran and Qatar do (did?) have military cooperation agreements, not only economic. [1] That's not a NATO style treaty but Qatar doesn't have a NATO style treaty with the US either.
The largest US base in the region is an air base in Qatar (which Iran has hit).