The Northern Irishman withdrew from the tournament in Florida following a disastrous first nine holes, which left him seven over par.
The 23-year-old complained of wisdom tooth pain following his abrupt exit, but Nicklaus believes that McIlroy made the wrong decision.
"I don't know how bad his wisdom tooth was but he should not have walked off the course and if he had thought about it for five minutes I am sure he would not have done it," the Daily Mail quotes Nicklaus as saying.
"Maybe I am talking a little out of school here. Rory is a really nice kid who tries to do the right thing but on this occasion I think he got it wrong."
Meanwhile, American pro Michael Thompson won the tournament yesterday.