All fluid will expand when heated, if the master cylinder was filled to the top, not leaving an air gap it will over flow when lid taken off. When brakes are applied there is a small amount of fluid which will squirt up within the reservoir. If the top gasket doesn't seal properly the gasket will leak making the outside of the master cylinder damp/wet.