I took the wallet out of a stranger's purse and put it in my pocket
Is there a reason why you wanted to take someone's wallet?
I thought I would take some cash out
Pickpocketing is widely regarded as a petty crime and you could face jail time and expensive fines. Return the wallet and try to make amends with the person you stole from.
However I can't because I already spent the stolen cash. Who would think to put an old wallet full of money in their purse?
That is where most people keep their wallets. If you are in need of cash, you shouldn't take someone's wallet. There are other ways to earn money if you need.