A class feature might give you a spell, but it explicitly says so in this case. See Barbarian's Path of the Totem Warrior for example:
At 3rd level when you adopt this path, you gain the ability to cast the beast sense and speak with animals spells.
A spell is a special term in 5e, a spell description always says its casting time, components, duration and range. For instance, only spells which duration is not Instantaneous can be dispelled.
The Wild Shape only says you assume the shape of a beast, not cast a spell:
Starting at 2nd level, you can use your action to magically assume the shape of a beast that you have seen before
That means it doesn't consume your spell slots, can't be counterspelled, and you can use it with your bonus actions on the same turn you cast a spell (providing your circle is the Circle of the Moon, otherwise you have to spend Action instead). It is still counts as a magical effect though, hence, wouldn't work in an antimagic field.