The court 's ruling Wednesday comes after a private lawyer challenged the legality of the impeachment motion against the president .