Triac gate burns after getting current on it
What you say is pretty surprising as this triac is pretty much overkill for a simple 40W resistive load.

The figure in the MOC3041 datasheet shows a very standard circuit for controlling a triac in particular,using a 300 ohm resistor instead of 360 Ohm is perfectly okay for a 240V AC main. 

The most likely cause of the death of your triac is that the capacitor discharges too fast in the triac when the latter is turned ON. Using a higher capacitor value than 0.01µF could induce a high current spike that can kill the triac.

My recommendations:


Please check that you used the right scheme: are you using a
110V AC main or a 240V AC main?  
Please check the rating of your capacitor ; it must be less than or equal to 0.01µF.   
If all you want to control is a resistive load, you can also completely
remove the snubber. The snubber is only useful in case of noisy environment or highly inductive loads; on top of that the T1635H seem to have pretty solid snubberless performances that could probably allow you to remove the snubber all together.