I don't like it any more than you do, but the people who don't pay attention to politics but vote anyway are the ones you have to attract in November. They determine the outcome of the election.
Guiliani might lose the support of the one-issue conservatives, although I think many of those might still support him if the alternative is President Hillary. They wouldn't like it, but the alternative is just too scary.
But Guiliani connects with the David Letterman audience, and that's not something to be dismissed as politically irrelevant.
He also appeared on the obscene Howard Stern TV show a few times. And that's not something to be dismissed as politically irrelevant either. I'm sure that the socially conservative grassroots will have nooooo problem with him associating with such filth. Gotta get the word out on that too.