Would the professor be annoyed if I failed two grad school applications in previous year? I applied to two places last year; both failed. I am not sure if I ask the professor to write a letter for me again, would he be annoyed? How should I tell him? 

If I tell him that I failed, would that cast a negative impression of me on him?
Two rejections are not so many, especially if you applied to highly competitive universities/departments. Some suggest applying to as many as 10 different places (of course, assuming you find so many research departments that interest you).

Just ask your professor again, I would not expect him to be annoyed. Even though we cannot know for sure how he will react, the uncertainty about his reaction should not block you from pursuing your academic goals.