Why is clownfish attracted to actinia?
It's an example of SYMBIOSIS

Clownfishes(Amphiprion ocellaris) are never found without an anemone as they have this obligate association with them. Although they can survive without them, but studies show they are much more healthier with than without.

This association is more of a survival necessity. These anemones are actually toxic and the fish is resistance to it. If being attacked they will get inside these and the attacker might be stung with this actinotoxin.   

Also,


  The presence of an anemone is also essential to reproduction of the
  fishes: their eggs are laid beneath the oral disc overhang of the
  anemone, where they are tended by the male.


Source:


Wikipedia on Sea anemone
INTERACTIONS BETWEEN FISH AND SEA ANEMONES
Clownfish and its mutualism relationship with anemones