Gas price is not constant. Although gas is dependent on the storage of the contract, the network congestion plays a great role.
Maybe when you are deploying the contract, the Goerli network congested more than usual. While the main net is free.
And there are other factors such as speeding up by providing more ether etc.
Look at the image above. It is what I got now when I tried to deploy a contract on goerli. So that might be the reason.
Also look at this image. There is something called base fee. Which is the minimum amount of fee required to include your transaction in the network. And the price can go above that based on network congestion.
You can read more about the gas fees here.
Tell me if it helps!