There are two basic reasons for this practice. Dangerous gases and dark smoke accumulate in a burning building; making it almost impossible for firefighters to see in such an environment. When a hole is made in the roof, the smoke and gases escape because heat and smoke rise through the opening, making it much easier for the firefighters in the building to see. It also reduces the possibilities of backdraft and flashover.
Another reason to cut a hole in the roof is to see how far the fire has progressed. One of the fastest avenues through which fires spread is the attic. Firefighters may go ahead of the fire on a roof, cut holes to access the attic and stop the fire from spreading through the attic.