The D&D rules used to be pretty clear on how clerics gain their powers. The alignment axes of good-evil and law-chaos create a sort of 2D map wherein each deity has a preferred range. If you stray too far from the sweet spot, your ability to cast spells, turn undead, etc. is supposed to diminish. In past BG series, the reputation score was used for some things, but was never really tied to cleric powers.