The advertised price was not the out-the-door price. There are always add-ons such as tax and license and temporary permit. The fine print probably also allows for additional add-ons and "market adjustments."
Yes it appears dishonest to advertise online a price and then when the buyer goes in to buy the car the dealer adds stuff on to raise the price. But what does the fine print say? The buyer has to get the out-the-door price from the dealer before going in to buy the car. There is always the fine print. Car dealers should be willing to give the buyer the out-the-door price. If they won't give that to the buyer before they buyer goes in then don't shop with that dealer.