My question is that what is the purpose of stick Imam holding during Friday and Eid sermons?

It represents power. In narrations, it is recommended to hold a sword, which was used in early ages as weapon, nowadays, the sword is not used, hence, in the Islamic Republic of Iran, Imam holds a shoot gun. However, if he can not do so, the recommendation goes down to a stick.