It's actually not quite so simply as the ref near it grabbing it. Depending on the play, and where the broken stick is at, the ref may elect to leave it be. I've seen broken sticks get 'accidentally' kicked/nudge near, or in front of the net which causes a sort of clean pass prevention '6th player'. The ref is generally reluctant to get too into the middle area of the play so a broken stick can become a sort of extra player out there. It's a kind funny/unique situation that doesn't happen that often.
Intentionally moving a broken stick to block or possibly block the puck is also a penalty. It is one of the more "judgment call" type calls a ref can make.