Iliyas Rahman, a lower court judge, committed the offence while he was posted in southwestern Begarhat district in August last year.
Rahman admitted his offence saying he had installed the camera at his colleague's bedroom "being influenced by adventure movies".
"The decision was taken in a full court reference chaired by Chief Justice ABM Khairul Haque ordered assistant judge Iliyas Rahman (of lower judiciary) be sacked for the 'immoral act'," a Supreme Court official told PTI.