In Mr. Robot Vera had an affection for Shayla, and the only one causing the problem was Elliot. So, why was Shayla killed even before Elliot tried to free Vera?
Vera treats Shayla like she's his property. He even tells Elliot in an earlier episode not to touch her because she belongs to Vera. She's a piece of his empire. When Elliot tries to use Vera's money against him as a bargaining chip (by hacking Vera's brother's cell phone), Vera decides to burn it all to the ground and start over. Vera doesn't have any more use for Shayla other than to extort Elliot into breaking him out of prison. She doesn't need to be alive to do that, so killing her is simpler than holding her somewhere.
Vera is trying to make a point, that he's not the person to be messed up with. Vera could still keep Shayla alive and give her back to Elliot when he's out of prison but he killed her because he wanted to hurt Elliot badly, teach him a lesson that he made a mistake by sending Vera to prison.
What really surprised me was that Vera leaving Elliot alive, even though Elliot was the reason for Vera being behind prison bars, Vera liked him, in previous episodes Vera found that Elliot is fearless just like him.