Non è che hai i magic quotes attivi?

In caso affermativo, applica stipslashes() prima di htmlentities().

Inoltre, perchè usi htmlentities() + html_entity_decode()?