"It isn't necessarily good for a child to never be scolded and only receive praise."
"It isn't necessarily good ~" 「〜が必ずしもいい事ではない」
"for a child to never be scolded and only receive praise" 「怒られないよう良い子でいること」
"never be scolded" 「怒られない」
"only receive praise" 「褒められてばかり」・「いい子でいる」
Just trying not to make the teacher angry with you isn't always a good thing.
この場合、次のような言い方ができますよ。
ーJust trying not to make the teacher angry with you isn't always a good thing.
「ただ先生に怒られないようにすることがいつも良いことではない」=「先生に怒られないよういい子でいることがいつも良いとは限らない」
ご参考まで!
Being a “good kid” just to avoid getting in trouble isn’t always a good thing.
Being a “good kid” just to avoid getting in trouble isn’t always a good thing.
Trying to be a “good kid” so you don’t get scolded isn’t necessarily a good thing.
Always being the teacher’s favorite doesn’t always mean it’s best for you.
Being well-behaved all the time isn’t always the best thing.
Playing it safe to avoid trouble isn’t always a good thing.
日本語の「怒られないように良い子でいる」は、英語だと
avoid getting in trouble(怒られないように/問題を起こさないように)
be a good kid(いい子でいる)
be well-behaved(お利口に振る舞う)
などで作れます。