Why would a bad head gasket cause the coolant reservoir to fill up?

Your head gasket is allowing high pressure combustion gasses into the low pressure cooling system. These gasses are displacing the water in the cooling system. There isn’t room for the gasses and the water, so the water gets pushed out. It’s as simple as that.
Since air doesn’t cool nearly as well as water does, the engine overheats. When it overheats, the remaining coolant boils and that just adds to the problem.