The Gunners struggled to break down the resilient Turkish side on foreign soil and settled for a 0-0 draw. They will need a result in the second leg if they are to progress to the group stage, and must do so without perhaps their most important player.
Merson says that Ramsey should have avoided putting pressure on the referee in the heated atmosphere in Istanbul.
"The first one is a nailed-on booking. Nailed on," Merson said on Sky Sports, where he now works as a pundit.
"And for the second one, when you're playing away in the Champions League, in a hostile place, don't give the ref a chance.
"He could give a booking, he could easily not give a booking, but don't give the ref an opportunity to do that."
Ramsey's was shown a second yellow for tugging on the shirt of Besiktas midfielder Oguzhan Ozyakup. Ozyakup, a former Arsenal player, appeared to go to ground easily, but with the passionate Turkish crowd screaming for a red card the referee saw fit to dismiss the Welshman.
Arsene Wenger was less than impressed with the referee's performance, but acknowledged that the physicality of both sides made it a difficult game to officiate.
"In the second half the performance of the referee was very bad," Wenger said. "Ramsey's second yellow card, I cannot see where that came from, it was a huge decision.
"I felt a lot was wrong in the second half but, overall, it was a difficult game maybe to referee as well because everybody did fight for every ball."
"We know the second leg will be certainly tight again, but we are at home, so the task is clear for us, we want to win."
Was the referee right to send off Aaron Ramsey against Besiktas?