Lorewise do Goliaths being anti-air make sense?

Why would an All-Terrain battlemech have its primary role be long range anti air?

Is there precedence in other sci-fi works and/or in real life military R&D?