First I should note that offside enforcement is vastly improved over what it used to be. My father and I were privileged to be among a select group of soccer supporters who, by virtue of the time difference between the US and Europe, watched much of our soccer on VHS in the 90's, and then on Tivo starting in the early 'aughts . All this playback, with the possibility of rewind and replay, made it frustratingly obvious to us how consistently inaccurate offside judgments were. The biggest frustration wasn't just inaccuracy, however, but the systematic bias of that inaccuracy in favor of defenders.
The root of the problem is a simple illusion. The assistant referee's attention in judging an offside offense must often shift up to 90 degrees and 50+ meters, from the attacker who passes the ball to the attacker who is the target of the pass, in the process of making a judgment. In just half a second, though, the relevant attacker and next-to-last defender could be separated by 10 meters if running in opposite directions at the time of the pass, even when the attacker started in an onside position.
Errors in offside usually favor defenders principally because of this illusion; while attacking players are generally running after the ball which has been played behind the next-to-last defender, the defenders are often caught standing still, or even purposefully advancing away from their goal line in an attempt to "catch" attackers offside or influence the assistant referee's perception of offside.
The other factor that biases referees in favor of defenders is the primacy and rarity of goals: people remember when an offside goal is allowed to stand, but too easily forget and forgive plays that are falsely called offside, even when they add up to many more potential goals.
Before frequent video playback, people just didn't notice that so many plays that were flagged for offside were actually onside, because nearly everyone's attention shifts in these plays in the same way. Enforcement of offsides has therefore been improving along with video technology. I remember not too long ago watching a VHS of the 1974 World Cup final. There's one striking play that any modern viewer would recognize as unequivocally onside, but that is called for offside in the match, and that the commentators and players on the field let slide with no protest whatsoever. Rewinding and pausing confirm that the attackers in the play are actually onside by more than a meter.
So what to do? As noted above, the proliferation of video technology has vastly improved the accuracy of offside calls, and assistant referees have eased their defender biases too. But they can only improve up to a point, because they're only human, and their visual attention can only be focused on one location at a time. (If you're unfamiliar with research on the severe limitations of visual attention, this experiment is a hilariously good place to start!) The only way to ensure accuracy is by allowing them to focus their attention on the next-to-last defender all the time, and not be distracted by the ball.
My friend Eli came up with a great way to accomplish this: simply have an extra referee, or the center referee, press a button every time a pass is made. If the button is hooked up electronically so that it makes a beep in the assistant's ear every time it's pressed, then the assistant can keep his full attention on the final line of defense, and coordinate the beeping in his ear with the positioning of the attackers in his visual field. This modification would allow the assistant to accurately judge whether a player is actually in an offside position when the pass is made, rather than attempting to shift his attention as quickly as possible between passer and receiver.