That's precisely the way the anti-doping code is supposed to work.
The players get educated on their responsibilities regularly throughout the year and indeed, during the off season. The crux of the matter is that each player is individually 100% responsible for compliance with the code.
The difference between a footballer like Rioli and a teenage athlete is that Rioli was surrounded by support - doctors, fitness staff, football administrators, coaching staff, other players and his manager. A teenage swimmer for example might have a coach (part time) and parents and yet the same responsibilities apply.
Shayna Jack failed a test for a banned substance believed to have come from a sports supplement and was given two years. SIA and ASADA immediately appealed as under the strict liability of the code a failed test is four years. Rioli interfered with his sample on two different occasions and that is considered the same as a failed test under the code. It should have attracted the full four years but the AFL has a strong track record of trying to dodge around it's obligations under the code.
Of course, if failed tests attracted sponsorship dollars, Rioli would have been handed life at least.
Those who claim that two years is fair completely miss the point of the code. It is intended to be harsh to make the prospect of cheating untenable. It's not a matter of hanging judges, it's a matter of known consequences to an athlete's personal choice.
If the system is good enough to be applied to 15 year old kids competing at state level sports, it's certainly good enough to be applied to an experienced professional professional sportsman who is surrounded by bucketloads of support personnel.
It really is that simple even when some try to muddy the waters.