The Federal Income Tax was created after with the 16th Amendment to the US Constitution in 1913. In those days, there was a strong movement advocating for Prohibition. A deterrent for Prohibition was the significant share of income that the US government had dependent on alcohol sales.
Income tax allowed the US government to get more income. By 1919, it was enough that passing the 18th Amendment with Prohibition was not a problem
For further information, read this article