22 trillion dollars over fifty years is 440 billion dollars a year, which is quite affordable for the US.
That we were able to afford it (sort of — the figure exceeds our current national debt), means, it is indeed affordable, no big news. The points you chose to ignore were: a) the cost of it exceeded the costs of all real wars of the Republic combined; b) the "war on poverty" is a flop — despite spending so much money, we have not achieved the goals Lyndon Johnson spelled-out, when he launched the program.
BTW, the answer to James Madison is Article
Oh, sure, david_thornley from the 21 century knows the meaning of the Constitution better, than the man, who wrote it...
provide for the common Defense and general Welfare of the United States
The interpretation you are proposing here is so wide, you can drive an air-carrier through it — sideways — and affords government limitless power. For example, NSA can claim, that their eavesdropping is for "general Welfare" (and great justice!), abortions can be banned — anything.
Or are you, perhaps, confusing the generic term "welfare" with the Welfare Program — and claiming, the Constitution's authors envisioned the program for the poor 200 years before it was (finally!) implemented?