Twitter uses open source because they do not have the resources to build and maintain custom infrastructure, nor do they think infrastructure is what distinguishes their business. It's that simple.
Only half that statement is true. Twitter has tons and tons of custom infrastructure. Most of those projects are largely built and maintained by Twitter. But their business is built on network effects not trade secret infrastructure, so releasing it as open source helps more than it hurts.