spoofed mac address changes when trying to connect to network

The answer to the solution is:

sudo service network-manager stop

sudo ifconfig wlan0 down

sudo macchanger -m XX:XX:XX:XX:XX:XX wlan0

sudo ifconfig wlan0 up

sudo service network-manager start

The macchanger line can be replaced with whatever macchanger command you need. or with sudo ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX