Whenever I select the Infiltrator class it won't let me switch to my sniper rifle. It instead forces me to use my sidearm.
The answer to this is due to the type of cloaking you're using: Stalker Cloaking
From the wiki:
Stalker cloak does not drain energy as long as the infiltrator remains stationary, allowing the cloak to last indefinitely. However, stalker cloak prevents the use of the infiltrators primary weapon and regenerates slower than normal cloak.
If you switch your cloaking to the default, which is the Hunter Cloak, then you will be able to freely use your primary sniper rifle again.