If you are physically giving up cash, it is much easier to figure out if you have insufficient cash to make a purchase. With a credit card, it is less obvious to figure out that the balance on the card now exceeds the cash you have to pay it off. It can be done, true, but it requires a level of diligence that most people don't have.
Even people who do have that diligence can be caught out. You do the calculation, make the purchase and a week later encounter an unexpected expense like your car breaking down, or you lose your job. You may now find yourself unable to make the full repayment despite having thought about the purchase before making it.