It is generally viewed it as a ploy to get working class votes. It probably is! The Harris campaign apparently thinks so as they adopted the proposal, even as economist dismiss it as a terrible idea.
But I think something else is going on. In June the Supreme Court effectively legalized bribery of a public official in Snyder v. United States. It’s a pretty outrageous case, but it came at the end of the Supreme Court term that was filled with outrageous decisions, so it didn’t get nearly as much attention as it deserved. In the case, James Snyder, mayor of Portage, IN was prosecuted for bribery when he demanded $13,000 from a local truck dealership after he secured the company a million dollar contract from the city. The Court ruled 6-3 that because the payment came after-the-fact, payment of the $13k was a "gratuity" not a bribe (never mind that Snyder demanded payment). It was a pretty crass ruling, especially considering how certain members of the Court have been caught regularly accepting bribes gifts from rich benefactors interested in the Court's rulings.
After the decision came out, I heard one commentator mention that because tips are taxable income, these gratuities can still be prosecuted unless the recipient of the "gift" reports them as income. It was only after that that I first heard about Trump's bold proposal to exempt tips from taxes.
Maybe it was a coincidence. The first mention of the proposal that I can find was on June 21, 2024, which was a few days before the Snyder decision was officially announced on June 26. But I wonder if the Trump campaign had advance notice that the decision would go that way. And even if that wasn't the original idea, I think post-Snyder, exempting tips would cut off what may be the one remaining way to federally prosecute bribery of public officials in the U.S.