I knew that I had taken part in discussions about this before so I had a look back through my notes. Here's (part of) a post I made on the topic back in 2011:
"One of the reasons I believe that most refs would never penalise a player for persistent offside infringements is that there is a qualitative difference between an offside offence and all other offences. Committing an offside offence is almost guaranteed to be something the player was desperately trying to avoid. By contrast, in almost all cases, all other offences that I can think of involve a deliberate action of a player who is trying to commit the particular action that causes the offence.
It is also the only offence I can think of (let me know if you can think of another) which can be directly caused by the actions of an opponent, rather than the actions of the player who ends up being penalised for the offence. When a player is caught out by a well-executed offside trap perpetrated by the defenders, it is difficult to apportion a whole lot of blame to the player caught offside. It can even be the case that the player, through lack of skill, knowledge or foresight, cannot avoid being offside, even though they are trying their level best not to be.
As others have pointed out, there is nothing specific in the Laws that would preclude this but to me it’s a combination of refereeing to the spirit of the law and using a large dose of common sense."
I would also throw in the fact that the IFAB back in 1994, even considered whether offside should be an offence at all, at least when it was the result of an offside trap. Here's an extract from a discussion paper included in the IFAB AGM minutes of that year:
"There are, unfortunately and increasingly, many occasions when attacking players who clearly have no intention of becoming offside (and who may even be attempting to positively remain not offside) are placed in offside positions by defenders moving forward quite deliberately to cause this to occur.
Such actions by defenders to contrive offside offences, if successful, lead to a proliferation of stoppages for indirect free kicks, to frustration for the innocent attacking players, and to failing interest and annoyance for spectators denied the enjoyment of more goals being scored, particularly in matches at senior level.
The question must, therefore, be asked, “Should a player who quite obviously has no deliberate intention of offending against the Offside Law ever be penalised?”
I don't know who exactly wrote this, there's no indication of its authorship but in any event, despite the sentiments expressed here, the IFAB ultimately decided to keep offside as an offence even when the player has been caught out by an offside trap.