No judge will ever make a ruling on the basis of "the spirit of the law". They may try to divine the intent of Parliament or Congress according to agreed interpretive rules.
But it's still about rules. Predictable, and precise.
Even the law of Equity, which is the closest to being the law that is about the "spirit" of the law ... relies on rules.
Otherwise you no longer have a government of law, you have a government of men. Those don't work very well.
The closest we can come to having a true government of law is for the process that generates law to be rooted entirely in natural law theory, where the law is "discovered" instead of created. Common law and equity are at least traditionally an attempt at this, but any system that makes room for positive law, or contains any sort of legislative institution, can't even be described as an attempt at a government of law.
Second, everyone knows that this "sorry, we have to pay royalties" thing is most likely legal, but a very grey area. It certainly is against the spirit of the law. A company whose main product is "we make you feel good" should not use such tactics in their own interest.