The court further said that whether those arrested were terrorists or not would be decided by the court and not by the state government.
The bench also asked the state government under what grounds were the cases being withdrawn.
The petition against the government's move was filed by social activist Rakesh Srivastava and advocate Nityanand Chaubey.
The bench also asked the state government on whether this move of its will not encourage criminals and terrorism.
The petition challenges the Akhilesh government move to withdraw the cases against persons involved in the March 7, 2006 bomb blasts in Sankatmochan temple, Dashwashmegh Ghat and Cantt railway stations.
The state government had issued notification Oct 31 seeking withdrawal of the cases against those accused in the blasts.
Lawyers of the petitioners A.K. Gupta and Shiv Shanker Tripathi said that the court has taken a serious view of the government move and had said that releasing those who are slapped with stringent sections of the Indian Penal Code (IPC) including 302, 307, 323, 427 and 120B, would not only send a wrong message but would also encourage terrorists.