Social Security was originally known as OASDI: Old Age and Survivor's Disability Insurance. It has its roots in some very old plans to take care of older citizens after they leave working age. Thomas Paine proposed it in the late 1700s in his pamphlet "Agrarian Justice"
But it goes much farther back than that.
And, here's a little background on Social Security:
Prior to the rise of company pension plans, paternalistic companies sometimes "graduated" older workers to token jobs at reduced pay. A few paid some form of retirement stipend—but only if the company was so inclined, since there were no rights to any kind of retirement benefit. Most older workers were simply dismissed when their productive years were behind them.
One of the first formal company pension plans for industrial workers was introduced in 1882 by the Alfred Dolge Company, a builder of pianos and organs. Dolge withheld 1% of each workers’ pay and placed it into a pension fund, to which the company added 6% interest each year. Dolge viewed providing for older workers as being a business cost like any other, arguing that just as his company had to provide for the depreciation of its machinery, he should also "provide for the depreciation of his employees." Despite Mr. Dolge’s progressive ideas and his best intentions, the plan proved largely unsuccessful since it required a worker to spend many years in continuous employment with the company, and labor mobility, then as now, meant that relatively few workers spend their whole working career with one company. Not only was the Dolge Plan one of the first formal company pension systems in industrial America, it was also one of the first to disappear when the company went out of business a few years later.
The biggest problem with company-provided pensions was that the percentage of workers anticipating an employment-related pension from their company or their union was tiny. Indeed, in 1900 there were a total of five companies in the United States (including Dolge) offering their industrial workers company-sponsored pensions. As late as 1932, only about 15% of the laborforce had any kind of potential employment-related pension. And because the pensions were often granted or withheld at the option of the employer, most of these workers would never see a retirement pension. Indeed, only about 5% of the elderly were in fact receiving retirement pensions in 1932.
Following the outbreak of the Great Depression, poverty among the elderly grew dramatically. The best estimates are that in 1934 over half of the elderly in America lacked sufficient income to be self-supporting. Despite this, state welfare pensions for the elderly were practically non-existent before 1930. A spurt of pension legislation was passed in the years immediately prior to passage of the Social Security Act, so that 30 states had some form of old-age pension program by 1935. However, these programs were generally inadequate and ineffective. Only about 3% of the elderly were actually receiving benefits under these states plans, and the average benefit amount was about 65 cents a day.
The Industrial Revolution transformed the majority of working people from self-employed agricultural workers into wage earners working for large industrial concerns. In an agricultural society, prosperity could be easily seen to be linked to one's labor, and anyone willing to work could usually provide at least a bare subsistence for themselves and their family. But when economic income is primarily from wages, one's economic security can be threatened by factors outside one's control--such as recessions, layoffs, failed businesses, etc.
Along with the shift from an agricultural to an industrial society, Americans moved from farms and small rural communities to large cities--that's where the industrial jobs were. In 1890, only 28% of the population lived in cities, by 1930 this percentage had exactly doubled, to 56%.
This trend toward urbanization also contributed to another significant shift in American society, the disappearance of the extended family and the rapid rise of the nuclear family. Today we tend to assume that "the family" consists of parents and children--the so-called nuclear family. For most of our history, we lived in "extended families" that included children, parents, grandparents and other relatives. The advantage of the extended family was that when a family member became too old or infirm to work, the other family members assumed responsibility for their support. But when the able-bodied left the farms to seek employment in the cities, often the parents or grandparents stayed behind. And when new immigrants first arrived in our land, it was often the breadwinner who first made the passage and only later could he bring the family over.
And finally, another significant change happened in the early decades of this century. Thanks primarily to better health care and sanitation, and the development of effective public health programs, Americans began to live significantly longer. In three short decades, 1900-1930, average life spans increased by 10 years. This was the most rapid increase in life spans in recorded human history. The result was a rapid growth in the number of aged persons, to 7.8 million by 1935.
The net result of this complex set of demographic and social changes was that America was older, more urban and more industrial, and fewer of its people lived on the land in extended families. The traditional strategies for the provision of economic security were becoming increasingly meaningless.
Social Security is not "welfare" or even a handout. It is social insurance. Basically using the government as a central insurance provider. By the time America adopted social insurance in 1935, there were 34 nations already operating some form of social insurance program(about 20 of these were contributory programs like Social Security). It really isn't taking from the rich and giving to the poor, like welfare can be construed as. In fact, it's not fundamentally different than your unemployment benefits when you are laid off of work.