Lord Shiva does Dhyana almost all of the time. Then why can't he control his anger? There were some very famous Rishis known for their bad tempered. How also they unable to control their anger?
These rishis were in process of self realization. Anger suppose to be the most hidden dosha which takes control over unknowingly. Only after the self realization it happens that person victors the "Shad Ripu". Till then it is a roller coaster ride when persons earns punya by Tap and meditation and keep losing them by falling prey to anger and other doshas.