...how do the feds collect taxes on illegal activity?.
Technically they don't. Instead they create agencies like the BATF and RICO laws and just seize all the cash they can. Or if you want to go old skool, recall why Al Capone went to Alcatraz (hint: income tax evasion)
...how do banks lend(fdic) to illegal businesses?.
The FDIC is a GSE (government sponsored agency) and therefore cannot make laws. Generally banks police themselves when it comes to business finance. If you want to lend money to a Polish corn farmer in Ohio who just happens to rotate his crops with the occasional maryjane and/or poppy seeds, that's your own risk.
But it is true, banks try and keep a good image. Wells Fargo used to (not sure today) have a policy that you could not lend money to one customer to finance the hostile takeover of another customer. They also prohibited lending to porn businesses, which is why City National Bank always shows up in the credits of most smut reels.