THE POST IS DARK AND FULL OF SPOILERS
Joffrey probably thought it was his idea, and elements are sick enough to carry his signature.
If you haven't seen the Red Wedding, it's incredibly disturbing. There's a war sort of akin to a five-sided chess board. Young Robb Stark, who has been playing the war part of the game well, has blundered. He broke his promise to marry a Frey girl in exchange for the tactical advantage of a bridge. Instead he fell in love and married Talisa, a foreigner with the tactical advantage of witty banter and a fine booty. Papa Frey is about as offended by this as anyone possibly could be, evidently, because he feigns forgiveness with the supposed acceptance of wedding one of his girls to Robb's uncle instead. He invites all the non-hidden or hostaged Starks and Tullys to said wedding, and does a little Charlie Manson on them, killing pregnant Talisa with a knife to her pregnant belly, and then almost everyone else, except for Blackfish Tully, who apparently decided to take a leak at exactly the right time. I'm guessing that the uncle didn't really marry a Frey after all, and was also murdered.
So, back to the scene that I love, in which Tyrion is horrified to piece together that while Frey is horrible enough to do this, he's not exactly brave enough to do it without permission, and that his Machiavellian father Tywin must have given the action his blessing. Everyone knows that war is hell, but everyone sort of accepts it in the same way we accept that for some reason our minds have to go unconscious and hallucinate vividly for a few hours every day: it's only normal because it happens so frequently. Take out that element and it's incomprehensible, if not strange. So, we all accept it. War happens, the victor gets to write history and claim moral authority even when everyone knows it's just who was stronger and not necessarily who was right, and then everyone goes about rebuilding a life that incorporates the new reality, because, really, if you don't, you'll go nuts because there's not much you can do about it.
However, a wedding, as Tyrion points out, does not have the same sort of social implications. There is a social contract that indicates that if someone has a problem with you that might involve a stabbing, that they won't invite you to a wedding. This implies that you are free to get a little tipsy and do the chicken dance, or whatever, and the only thing you have to worry about is where you sit and what you wear. Nobody is ever going to get over the Red Wedding. Tyrion points this out to Tywin, and his reply is "good". It's an illuminating answer.
Tywin goes further to defend himself morally, by saying that it's morally better to stab a few usurpers at a wedding if it prevents thousands (or whatever number) of deaths on a battle field. This is an interesting point, because at some level, lives are lives, but while one action (war) is viewed as a temporary harsh reality, no matter how horrible, the other, (the wedding) rips apart the fabric of society by violating the social taboo of hospitality. It changes the definition of the culture on a very fundamental level- weddings are not safe places to be and therefore the civilization has a crack in its foundation.
The scene includes a very interesting display of the slight moral shading between Joffrey and Tywin that essentially shows the difference between a psychopath and a sociopath: Joffrey wants to put on a public display, essentially showing that the Lannisters are complicit in the Red Wedding if not culpable: he wants to serve Robb Stark's head on a plate to Sansa Stark (now Lannister), who is their legally wedded hostage. This is the difference between a psychopath and a sociopath. Everyone at the table is horrified that Joffrey would even have this idea, and they pretend it's a bad joke. Joffrey insists that it's not a joke, and Tywin pretty much orders him to bed with a dose of poison small enough to knock out but not to kill. The choice of sleeping potion in itself is a message to the boy king: I can kill you, kid. Knock it off.
In other words, Joffrey is the Caligula to Tywin's Cesare Borgia.
Game of Thrones is full of historical gleanings, mashed together in a great stewpot of allegorical history. Even the name Lannister reminds one of the Lancasters from the War of the Roses. We all know that without Tywin, Joffrey would name his horse a senator and, well, serve a brother's head on a plate to a sister at a party. Joffrey wants to do it because it's his idea of what power means, and because it's his idea of a good time.
Tywin knows that kings who do this sort of thing eventually get killed and deposed. This is not Tywin's first time at the mad-king rodeo- you might recall that Tywin was the hand of the Mad King some twentyish (whatever age Dany is supposed to be) years ago. I also get the feeling that it's not the first time Tywin has ordered a crazy king doped up and knocked out so he can get some work done already.
Tyrion, as usual, speaks for the modern audience, albeit better than most of us could do. When he points out that smart people will figure out that Frey's taboos won't be overlooked by society, Tywin is fine with that. There isn't much difference between Joffrey making a public display and Tywin's implicit approval of the wedding when Frey and conspirator Roose Bolton reap political advantages as a result of their stabbing party, but the difference is significant.
Joffrey's public display of crazy guarantees that assassination will happen as soon as someone is brave enough, to the relief of all, while Tywin's godfather routine probably guarantees that if someone wants to take over, they'd better have some dragons or an army of White Walkers.
Otherwise this show would be called something different. Something decidedly Tywin-centered, I would think.
Speaking of which, I wonder what the cultural significance (if any) is of all these Machiavellian shows out there: Game of Thrones, House of Cards, the Borgias, Da Vinci's Demons (the Medicis, who are main characters of that show being Machiavelli's patrons, and the political atmosphere of the time being the inspiration for The Prince). I recommend watching some of these shows side by side- it's fascinating to see the parallels.

