Board Thread:Questions and Answers/@comment-25371179-20160627111506/@comment-15736398-20160704024523

Ellaria and the Sand Snakes killed Doran and Trystane in order to put themselves in power and in a position to do what Doran refused, which was to use the Martell armies to attack King's Landing and kill Cersei and anyone else Ellaria felt was responsible for Oberyn's death.

Allying themselves with Daenerys accomplishes that goal, but it wasn't their aim... it's merely become the most expedient means of accomplishing their aim, and it means they don't have to "go it alone".