Li Shenron
Legend
From the rules point of view, both Clerics & Druids have to deal with "aligned" spells: but remeber that this works for Good and Evil spells but also with Chaotic and Lawful spells (PHB page 32, 35). Paladins of course have spells that necessarily are never Evil or Chaotic. Curiously enough, this restriction does not apply for Rangers, although they are Divine spellcasters as well. Pay attention that not only Clerics are prohibited from casting spells opposed with their alignment, but also opposed with their deity's alignment!!!
From the role-play point of view, your DM decides by himself if he wants a more strict behaviour.
note 1: the restriction to druids is in my opinion a little suggestion for a druid to tend toward true neutrality
note 2: on page 31 (PHB) about Cleric spells it said something like "alignment restriction means casting some spells has unpleasant consequences" but actually you CANNOT cast them at all: let's say the Cleric does not get the power from a deity which is against that alignment
From the role-play point of view, your DM decides by himself if he wants a more strict behaviour.
note 1: the restriction to druids is in my opinion a little suggestion for a druid to tend toward true neutrality
note 2: on page 31 (PHB) about Cleric spells it said something like "alignment restriction means casting some spells has unpleasant consequences" but actually you CANNOT cast them at all: let's say the Cleric does not get the power from a deity which is against that alignment