Depends on the crime. Not all things that are illegal are morally wrong. I don't think stealing in and of itself is morally wrong and largely depends on your needs vs the overall wealth of who you're taking from.
So is burglary justifiable according to this logic?