Not always. I got my Apache commit rights while working for an investment bank, where I was employed specifically to work on open source code, and since then have worked on multiple open source projects on GitHub, and sometimes even for investment bank clients interested in using our open source software. I don't think having a GitHub or Apache account is a hindrance to employment at all, these days.
Banks are indeed one of the most secretive and protective institutions, along with a lot of other related ones in the financial sector. They also tend to have more authoritarian practices, which can explain why they're not so keen on their employees doing even remotely-related stuff outside of their work.