The basic function of a switch is transparent bridging - for this, it doesn't need any MAC address of its own.
However, if you need to talk to a switch - ie. a managed switch - then that switch requires an address; usually that is a MAC address and an IP address [*]. STP is only supported on managed switches and in addition, an STP bridge is required to have a bridge ID which usually is identical to the management MAC address.
[*] A managed network device could just have a serial console which doesn't require any addressing. However, this was only used on very early devices. Today, most devices feature both, in-band network management and out-of-band console access.