If you find a software bug in an ATM that gives you all the money from the machine it absolutely would be considered theft. A bad lock on a door (or even no lock) doesn't give you the right to steal things behind that door. IMHO this is how the law would look at it and not care a wit about whether or not there was a flaw in the software. IANAL but have seen this kind of argument play out ever since computer bugs were exploited by unauthorized individuals.