I haven't created this mod. But the code says that it is intented! You get money for removed buildings, the removed religion itself and you will get a bonus for a remove of a holy city. And as it seems this may result in about 3000-5000 gold. No bug here. But maybe it is not well balanced. I have no experience with this feature.