From the overview:
The federal government spent $3.3 trillion in the states during its 2014 fiscal year. But the amount and composition of federal spending vary widely from state to state. As a result, federal budget decisions that increase or decrease areas of spending affect each state differently. The distribution of federal spending provides important context for understanding the effect that federal fiscal policy has on the states.
This analysis combines publicly available data sources to show the state-by-state distribution of federal spending, divided into the five major categories:
• Retirement benefits, which are payments to individuals and include Social Security retirement, survivor, and disability payments; veterans’ benefits; and other federal retirement and disability payments. Social Security accounts for about four-fifths of these payments.
• Nonretirement benefits, which are payments to individuals and include Medicare benefits, food assistance, unemployment insurance payments, student financial aid, and other assistance payments. Medicare accounts for nearly two-thirds of these payments.
• Grants, which include funding to state and local governments for a variety of program areas such as health care, transportation, education, and housing, as well as funding for individuals and other nonfederal entities, such as research grants. Medicaid grants to states account for about half of all federal grants.
• Contracts for purchases of goods and services, from military and medical equipment to information technology and catering services. Defense purchases account for two-thirds of federal contracts.
• Salaries and wages for federal employees. Roughly two-thirds of this spending is for civilians, and one-third is for military personnel…..
• Federal Spending in the States: Methodology (PDF)
• Ten-Year Historical Data (XLS)
• States Tables (XLS)