It is true that people say this. While I know that the plural of anecdote is not data, I will tell some stories. I camp in black bear country (Algonquin and other Ontario parks) and we hang our food or put it in barrels. We never allow any food in the tent, but we do keep soap, toothpaste etc in the tents and we may have someone in the tent who has rubbed scented hand lotion on just before bed. Certainly everyone brushes their teeth before bed.
I have had two bear encounters. One was broad daylight, we were washing breakfast dishes, I saw the bear coming down the trail and said "oooh" and after a period of mutual staring, it turned and ran back away from us. It was not fullsize. Our food was down but the bear was technically never in our site. The other was at night during a very dry period in which all campfires were banned, and there had been reports of very hungry bears interacting with people. The bear walked past our two tents (each family thinking it was an adult from the other family walking past) then bashed around the bear barrels for a while. This got everyone's attention. It then gave up and walked right past our tents and off into the woods again.
This second bear utterly ignored our tents, didn't even pause and sniff. It walked right past. Trust me, I was paying great attention to where it was, how it was breathing, etc. My children were in that tent with me. And the children of my closest friends were in the next tent. We were scared. Yet, the possible presence of toothpaste inside did not attract the bear. This bear was hungry enough to smack at barrels, and at stacked empty pots and pans, but didn't even stop for a better smell of the various lotioned, scented-shampooed, toothpasted people and their supplies inside the tents.
I've heard all kinds of wild claims about what will make bears break into your tent. Women in general have been listed as dangerous. Then only women who are fertile, or menstruating, or wearing perfume. None of it is backed up by actual anecdotes, just by the fear of "wouldn't it be awful if a bear busted into the tent and attacked us! Surely any inconvenience is worth it to avoid that!" From where I sit (and remember, I put my own children where my mouth is,) telling people to be afraid of their toothpaste and shampoo is not sensible. If it's simple to toss your "ditty bag" in with the food, then go ahead. But don't lie there in the dark wondering if the peppermint on your bedtime breath will lead to the death of you all. It won't.