Firstly, every form of showing yourself and being seen by others is not forbidden/harram.  For example, husband and wife make themselves presentable and beautify themselves for each other’s pleasure and that is a form of worship in itself.

Islam advices us to attend mosques for prayers and that also is a form of showing yourself, but it is for the glorification of religious rituals.

The mourning for Imam HusseinPBUH ([1]) through presence on roads and public places is a form of public demonstration, but hidden within this public display is worship.

Secondly, the presence of some individuals in such gatherings and in mosques can itself practically encourage others and is a form of propagation to others.  If the well-respected individuals and those we look up to go to the local mosques, the community will also naturally follow the lead.

Showing off is haram where our intention and goal is showing off, not for the work being done.  For example, if we go to such places so we can tell others how good we are and of how moral we are, that is hypocrisy and haram.  However, if the intention is to encourage others to go by practically telling them “look I have come, so should you”, that is practical propagation and has reward in it.

[1] The third Imam, martyred in Karbala in 61 AH by the army on the order of Yazeed Bin Muwaiah, may he be cursed.