I agree that Madison's intent may well not have matched up with his ultimate effects, but it is effects that matter.

Yes his thinking and positions evolved, yes he recognized that the landed would need protection from the unlanded that a pure democracy was not likely to provide. The end result is a form of government, and a codified set of constraints on governmental powers, and preservation of state and individual powers that in its own, clumsy, ineffective way, works to prevent the type of Poor Governance that gives rise to insurgency.

As lesson for Afghanistan is that just as the Articles of Confederation were adequate to get the US through the war with England, but would have doomed the emerging nation; Afghanistan too should strongly consider what an evolved Constitution would look like for them that is more appropriate for the nation that is emerging there.