"Street of Dreams, Feet of Clay, a novelette by Robert Sheckley, originally published in Galaxy Magazine, February 1968, available at the Internet Archive. Does any of these covers ring a bell? (A version of this story was incorporated into Sheckley's novel Dimension of Miracles, chapters 22–23.)
Protagonist is a near vagrant in the future, he hears about an automatic city where all is free so he follows hints until he finds it.
Thus, no single factor can be adduced for Carmody's sudden decision to leave what was generally considered the world's most exciting megapolitan agglomeration. Blame it on a vagrant impulse, a pastoral fantasy, or on sheer perversity. The simple, irreducible fact is, one day Carmody opened his copy of the Daily Times-News and saw an advertisement for a model city in New Jersey.
"Come live in Bellwether, the city that cares," the advertisement proclaimed. There followed a list of utopian claims which need not be reproduced here.
Totally deserted but all sparkly clean and City Voice welcomes him as he arrives.
"I do hope you like it," a voice said from behind Carmody's left shoulder. [. . .]
"Permit me to introduce myself. I am Edward Carmody." He turned, smiling.
But there was no one behind his left shoulder, or behind his right shoulder, either. There was no one in the piazza, nobody at all in sight.
"Forgive me," the voice said. "I didn't mean to startle you. I thought you knew."
"Knew what?" Carmody asked.
"Knew about me."
"Well, I don't," Carmody said. "Who are you and where are you speaking from?"
"I am the voice of the city," the voice said. "Or to put it another way, I am the city itself, Bellwether, the actual and veritable city, speaking to you."
He enters a cafe and orders a large meal (steak? I can't remember) with fries. City tries to talk him into healthy choice salad but he prevails.
He was guided to the fashionable Rochambeau Cafe, where he began with potage au petit pois and ended with petits fours.
What about a nice Brie to finish off?" the city asked.
"No, thanks," Carmody said. "I'm full. Too full, as a matter of fact."
"But cheese isn't filling. A bit of first-rate Camembert?"
"I couldn't possibly."
"Perhaps a few assorted fruits. Very refreshing to the palate."
"It's not my palate that needs refreshing," Carmody said.
"At least an apple, a pear and a couple of grapes?"
"No, no, no!"
After some more nagging, Carmody finally accepts a bunch of grapes.
After the meal he wants a cigar and City gives him grief about lung damage before giving him his smoke.
Actually Carmody is a cigarette smoker:
"You're doing a lot of smoking," the city pointed out.
"I know. I feel like smoking."
"As your medical advisor, I must point out that the link between smoking and lung cancer is conclusive."
"I know."
"If you switched to a pipe your chances would be improved."
"I don't like pipes."
"What about a cigar, then?"
"I don't like cigars." He lit another cigarette.
He then settled back in an armchair and says he'll take a nap, City goes on and on about a snooze facility just over the street until, to shut it up, he goes over there.
"Excuse me," the city said. "What are you doing?" Carmody sat upright and opened his eyes. "I was taking a little nap," he said. "Is there anything wrong with that?"
"What should be wrong with a perfectly natural thing like that?" the city said.
"Thank you," Carmody said, and closed his eyes again.
"But why nap in a chair?" the city asked.
"Because I'm in a chair, and I'm already half asleep."
"You'll get a crick in your back," the city warned him.
[. . . .]
He was guided out of the restaurant, down the street, around the corner, and into a building marked The Snoozerie.
He lays on a snooze couch but then gets up because he's now wide awake.
There was a long silence. Then Carmody sat up.
"What's the matter?" the city asked.
"Now I can't sleep," Carmody said.
He gets a choc bar from a vending machine (something called a Baby Ruth)
"What's this?" Carmody asked.
"It's a candy machine," the city told him.
"It doesn't look like one."
"Still, it is one. This design is a modification of a design by Saarionmen for a silo. I have miniaturized it, of course, and—"
"It still doesn't look like a candy machine. How do you work it?"
"It's very simple. Push the red button. Now wait. Press down one of those levers on Row A; now press the green button. There!"
A Baby Ruth candy bar slid into Carmody's hand.
and again has to endure a lecture about healthy eating and tooth decay while he eats it.
The lecture is about littering:
"Huh," Carmody said, letting the candy wrapper slip from his fingers.
"That," the city said, "is an example of the kind of thoughtlessness I always encounter."
"It's just a piece of paper," Carmody said, turning and looking at the candy wrapper lying on the spotless street.
"Of course it's just a piece of paper," the city said. "But multiply it by a hundred thousand inhabitants and what do you have?"
After two or three days of this nagging, with City criticising his big fry-up breakfasts and his slobbish ways, he's had enough and heads off out of the place.
"Where are you going?" the city asked. "What's the matter?"
Silent, tight-lipped, Carmody continued past the children's park and the American Express building.
"What did I do wrong?" the city cried. "What, just tell me what?"
Carmody made no reply but strode past the Rochambeau Cafe and the Portuguese synagogue, coming at last to the pleasant grass glade that surrounded Bellwether.
I think it ends with deserted city shouting "Ingrate" to his distant figure as he hurries away.
"Ingrate!" the city screamed after him. "You're just like all the others. All of you humans are disagreeable animals, and you're never really satisfied with anything."