I understand how Arwen gave up an immortal life for Aragorn but I don't understand why she was dying because of the evil from Mordor. Can anyone explain?
In the book, she wasn't dying. She made the choice to be mortal, but 'It was not her lot to die until she lost all that she had gained', as written in the story of Arwen and Aragon in ROTK appendices. My guess is that Peter Jackson decided to make that into the trigger for Aragorn to claim his birthright.
The logic is that Arwen chose to be mortal but she was not tied to Aragorn yet cos of the War. So since she had nothing to keep her alive, she was dying. It was maybe the only thing that would've spurred Aragorn to claim his birthright and take the Dimholt road. Again, this does not tie with the events of the book.
In the book, Aragorn was already willing to claim his kingship. He was just waiting for the right time. Thus, Arwen merely had to wait for Aragorn to claim his kingship and marry her. But in the movie, he was reluctant to be king. It was Elrond's plea because Arwen was dying that drove him.
In movieverse, the 'evil that spreads from Mordor' was in some way affecting the Elves. They were becoming weaker and they felt threatened. But all the Elves had 'the life of the Eldar', so they were protected. Once Arwen renounced her immortality, 'the life of the Eldar left her' as Elrond said. So she was affected even more. And began to die.
ALL Elf fate was tied to the ring. The Three Rings of Power granted to the elves "Preserved" their kingdoms from the ravages of time, but ALSO from evil forces and machinations. Elves are Immortal, thus cannot die from the ravages of TIME. However this is not perfect, Elves in fact can "Die" from weariness; which can encounter from Great emotional or spiritual turmoil. Elrond's own wife sailed away
I think Elves were meant by supreme God of that world to "fade", slowly lose their magic/power and likely immortality if they stayed in middle earth, thus clearing way for era of men. The elves tried to degree to cheat fate by making the rings of power which stopped the fading of the magic, but were tricked by Sauron so that if his ring survived theirs would be enslaved and if his was destroyed, theirs would also lose power.
If it were just Elrond leaving then there would still be left behind thriving immortal realms of pure elves (with only the half elves gone), but instead all the elves were leaving because they would also all fade and likely eventually no longer be immortal.