Yeah it's called lifestyle inflation. He probably started taking out loans immediately after getting drafted using his rookie contract as collateral in anticipation of getting a big 2nd contract. Below is how much he's made each year since entering the NBA.
2016 - $1,627,320
2017 - $1,700,640
2018 - $1,773,840
2019 - $2,731,713
2020 - $13,425,895
2021 - $14,491,964
2022 - $15,558,035
2023 - $2,709,849
2024 - $6,000,000
He signed a four-year $60 million contract in 2020. The fourth year was a $16.5M team option that the Lakers declined in 2023 and he was offered a vet minimum by the Bucks. By that point he was accustomed to living on over $13 million per year and probably didn't downgrade his lifestyle. Hence the loans and the gambling.