Early income taxes in the US were either temporary (the Civil War income tax expired in 1872) or found to be illegal (struck down by the Supreme Court in 1895, #3 AFTR 2602, 157 U.S. 429, USSC, 1895). There was confusion over direct and indirect taxation of citizens with or without apportionment based on a national census.
Corporate income taxes were enacted in 1909 (upheld by the Supreme Court in a challenge in 1911).
Congress got over the apportionment clause at about the same time with the passing of the 16th amendment:
"The Congress shall have the power to lay and collect taxes on incomes from whatever source derived, without apportionment among the several States, and without regard to any census or enumeration." (February 25, 1913)
Congress immediately passed the Revenue Act October 3, 1913, retroactive to March 1 of that year.
(Many people are in prison as we speak or have been fined and penalized into oblivion because they seem to think that they don't have to pay taxes. Ignorance of the authority of Congress sometimes hurts.)
I believe that revenues collected from individual income taxes, corporate income taxes, payroll taxes, and trust and estate taxes are drawn into the general fund of the federal government, and so the amounts can be used to pay for almost anything.
Here is a link to the budget of the US Government:
Remember that the budget of a government is enacted and becomes enforceable law, the financial statements of the government merely report how closely they follow the budget guidelines.
Governments use fund accounting, and that means that funds are authorized, getting money into the funds is specified by law, and amounts that a fund can expend are also limited by law. (Each fund has its own specifications.)