Not from the start of the character but after the post-Crisis relaunch, this became his constant trait:
The first post-Crisis appearance of Captain Marvel was in the 1986 Legends miniseries. In 1987, Captain Marvel appeared as a member of the Justice League in Keith Giffen's and J. M. DeMatteis' relaunch of that title. That same year (spinning off from Legends), he was given his own miniseries titled Shazam!: The New Beginning. With this four-issue miniseries, writers Roy and Dann Thomas and artist Tom Mandrake attempted to re-launch the Captain Marvel mythos and bring the wizard Shazam, Dr. Sivana, Uncle Dudley, and Black Adam into the modern DC Universe with an altered origin story.
The most notable change that the Thomases, Giffen, and DeMatteis introduced into the Captain Marvel mythos was that the personality of young Billy Batson is retained when he transforms into the Captain. This change would remain for most future uses of the character as justification for his sunny, Golden-Age personality in the darker modern-day comic book world, instead of the traditional depiction used prior to 1986, which tended to treat Captain Marvel and Billy as two separate personalities. - Wikipedia
Even his childlike personality get used as his weakness in some stories.