This post TL;DR. As a less experienced ref I am coming to a a broadly revised understanding of the application of the 2017 laws which is different to my original interpretation.
Advantage law is to be seen in the context of trying to promote continuity in play. A ball being run dead or played dead from a knock-on into in-goal is not consistent with this principle. However, a ball played from such a situation by a kick, with the intent but not necessarily the desired outcome, is consistent with trying to achieve continuity in play while allowing a team to play the ball as they wish.
Now to head into the 2018 laws to check how my current thinking is challenged.
WR. You do me no favours!
Indeed WR have done referees no favours. But when was it any different.
I understand your point about a kick to touch on the KO into ingoal scenario. But, there are crucial differences:
1: The kicker has, by skill, obtained a teritorial advantage. By merely grounding the ball, with no particular skill involved, has made a gain in ground of 22 metres (17 allowing for the scrum coming in 5 ) which is "too much" to gain without being earned.
2: The kick may be a two option kick. There is the possibility of a chaser from the kicking side regaining possession and then running and then developing an attack.
3: The kick to touch / upfiled involved risk. A counter attack from a ball prevented from getting to touch / a QTI or a best lost possession.
Where as simply dabbing the ball down is "risk free". So the law makers have cosidered the situation and said "no, that is too much
unearned advantage". If you think of it as unearned rather than simply too much advantage. It makes more sense.
Move the knock on up field and "dab down and gain ground" option is not there. So there is a sense to make it so here too.
We also come back the the principle . The ball goes dead (if indeed it does at all) AFTER the kick and not at the moment of the kick adnd the advanteade (gain in ground) exists before the ball arrives in touch (becomes dead). where as the ball is dead the moment it is dabbed down so no advantage is now possible