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.
1: https://web.archive.org/web/20251205012956/https://www.tehra...
That is still not an alliance. The US and Qatar have an alliance, which is why the US has bases in Qatar.
If the bases of a belligerent nation is in a neighboring nation, participating in operations, then the neighboring nation is not a neutral party.