Is it legal? Ask a lawyer, not the Internet.
Is it right? Yes.
If he had stolen basic sustenance (bread, meat, veggies, water, etc) then most people wouldn't have a problem, because his situation would be taken into account and nothing would come of it. BUT, he did NOT steal a basic...