A child who only studies and never plays will go bad.

Literal

Study only [with-で] doesn't-play [if-と] child [topic-は] no-good becomes.

勉強ばかり ('nothing but studying') uses ばかり for an 'only X, nothing else' flavor with a negative-judgment overtone — contrast with だけ, which is more neutral. The で here is the te-form of the copula linking two states: 'is only studying and doesn't play.' ~と conditional gives the inevitable result. A riff on 'all work and no play' proverb-logic.