Protein lose their function when exposed to heat as they undergo denaturation process. The heat causes the bonds to loosen and and break. As a result the structure of the protein will also changes. Since their structure isn't the same after denaturation, they lose their functional properties as well. Therefore, it's best to keep protein in its optimal condition (temperature, pH and etc.).