Switch Inc. gathered $2.6 billion of bank pledges to help the data-center operator procure electricity, a mounting challenge for the booming industry and one of its biggest costs.