From what I've read, there is no legal requirement that you pass the bar to work for a judge.
Many federal judges do not specify a requirement. However, your ability to receive a pay increase may be affected if you do not pass the bar. Notably, you can take the bar in any state--not just the one in which your court sits (unless the specific judge makes this a condition of your employment - unlikely).
Many state judges often request that you pass the bar of the state.
But there are exceptions to both rules.