Because it has to remain impartial and outside the control of government. When the judiciary is close to politics, they tend to be partial in their judgements.
They must be independent and free from all forms of political activities as that is the only way they can function effectively and efficiently.