Having started reading into the attack on the mosque in Egypt, a major if not defining point is that the victims of the attack were Sufi Muslims, meaning those who are considered generally moderate and more liberal in their reading of the Koran. The attack was carried out by Sunni extremists, notably the Wahhabists sect, as they have a particular hatred for the Sufis who they consider heretical because they are not so literal about the matter and that, apparently, they place a higher value on their holymen to which is viewed as polytheism to an extent.
This should be noted as a tragedy all the same despite the fact both factions support Sharia Law, execution of homosexuals, child marriages and honor killings. Massacres, especially in houses of worship are about as offensive and evil a crime one can carry out against humanity as a whole. There are things worse than that, but legitimately these people were slaughtered just because the radical Muslims think them heretics.