"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.
「ただ先生に怒られないようにすることがいつも良いことではない」=「先生に怒られないよういい子でいることがいつも良いとは限らない」
ご参考まで!