All life carries some risk. There is a huge difference between managing risk and gambling.
Banks are not gambling when they loan money. They don't loan you money in the HOPE of charging you interest. They charge you interest. They cover their risk by charging people who are a greater risk a higher interest rate. And sometimes, loans are secured by property, which they take if you default on the loan. When they do sometimes take losses on loans, they more than make up for those losses on the interest they collect on good loans, and they mitigate some of those losses by taking and reselling the security for those securitized loans.
Trading in individual stocks is gambling. That is not investing. Investing carries risk, but investing is buying and holding, and in cases where dividends are paid, reinvesting those dividends. Trading is gambling. When you lose money trading individual stocks, you do not have the cushion against losses that a bank has.