He tried to kill her along with his twin, Liv, but they were unsuccessful. Later on, Elena and Caroline were desperate for Liv's help. So Elena was okay with Caroline killing Luke to use him as leverage to get Liv to help Bonnie bring their loved ones back from the Other Side. When Luke came back, he saw the spell was killing Liv so he stopped her, which caused Damon and Bonnie to both be stuck on the Other Side moments before it was destroyed.
In the beginning of Season 6, it is revealed that Luke feels guilty for doing what he did to Elena and he tries to make up for it by suppling her magical drugs to see Damon. She resents him for what he did, but they both have grown closer to consider each other friends.