There should be no analogies, as comparing software to the real world means you're profoundly ignorant to begin with.
Software is real. It's part of the world. Same as the internet - it isn't a "cyberspace", it's people sitting at keyboards, and servers in real places, with actual cables between. And laws apply to those people, servers, cables, and software. And analogies apply equally well and equally badly between software and the rest of the world as they do between other parts of the rest of the world. Some analogies are useful, some less so. Just because it's "software" doesn't make it, and the processes that produce it, magically immune to logical, ethical, and legal analysis.