If you say that the members of a group close ranks, you mean that they are supporting each other only because their group is being criticized.
Conservative MPs intend to put aside their differences over Europe and close ranks behind the Prime Minister.
Institutions tend to close ranks when a member has been accused of misconduct.