It's because he didn't expect Law to stick around for as long as he did, and not play as integral of a role as he's had thus far.
In Oda's One Piece talks published in Shueisha's Weekly Shonen Jump (as spotted by @Sandman_AP on Twitter), Oda mentions that he didn't expect Law to be as important as his creation was done on a whim, "I created Supernovas [Editor's note: The eleven top rookie pirates of the "Worst Generation" of pirates] right before the chapter where they got introduced. None of them existed in my plot notebooks before that chapter...Then, inspiration for 9 Supernovas came to my mind unconsciously...I'm really surprised they survived until now since I thought half of them would drop out of [sic] tough new world already..."
As for Law himself, Oda stated that he "imagined Kid would become an important character, but...Law!! I didn't imagine he would become such an important character."
Oda may not have pre-planned the creations of Law and his counterparts, but he's rolled with their popularity and integrated them into the story in major roles.
Eiichiro Oda also revealed some upcoming news for One Piece's future at Jump Festa 2018. Not only will the manga see Wano sooner rather than later, the next villain of the series is "one of the legends which lurks in the One Piece world. The greatest enemy ever for Straw Hats will hinder their way...Can you believe Marineford Summit War will look 'cute' compared to that?"
The new live-action One Piece series also got some new information as it was revealed that the series will portray the Straw Hats' adventures from the very beginning, and will take place in the East Blue.
Eiichiro Oda's One Piece first began serialization in Shueisha's Weekly Shonen Jump in 1997. It has been collected into 87 volumes, with a few chapters yet to be included. It has been a critical and commercial success worldwide with many of the volumes breaking printing records in Japan. The manga has even set a Guinness World Record for the most copies published for the same comic book by a single author, and is the best selling manga series worldwide with 430 million copies sold worldwide.
One Piece is currently in the middle of the "Whole Cake Island" arc and is now streaming on Crunchyroll and FunimationNOW.