King Joffery's legacy.
How would the average commoner in King's Landing have felt about Joffery after his death?
While there were definitely stories and rumors about his cruelty as well as a general distain for Lannisters (as we saw with Cersei's walk of atonement). And his lineage was always in question. Most commoners would not know these stories for fact, and as we saw with the play in Braavos, the stories can be twisted.
The only things known for fact were that during his short reign he won two wars, one of which while under siege and attempted invasion of Kings Landing. The only people who knew Joffery was hiding in the Red Keep were the men actually there when he left. Tyrion never got any credit for his role. As far as anybody knew, it was Joffery and Tywin who saved the day.
Then word of Lady Margery's kindness and charity helped her gain favor among the people, and by proxy Joffery. And after the defeat of the North, we see a statue of Joffery holding a dead wolf. How the war was won, and the Red Wedding may not have been common knowledge, except that those in the know.