This is a great question. As you correctly note, there are two main versions of the story. However, there were alternate endings. Timothy Gantz has written a great book on the various strands of stories in ancient Greece and Rome. In one of the endings, Medea accidentally kills her children by trying to make them immortal. Seneca could have used this ending or created another, but for the most part he followed Euripides' version. Medea kills her two children, because she wanted to exact as much punishment as possible on her lustful and cheating husband, Jason.
Where Seneca's account differs is in the details. Seneca's Medea is much more of a force to be reckoned with. She also kills one of her sons right in front of Jason. In Euripides' account, Medea does all the killing offstage. Moreover, in Seneca's account, she has no remorse; in Euripides' account, she is almost a figure with whom you can sympathize.