The question the court looked at: Did Congress intend "receiving gifts as a bribe" and "receiving gifts as gratitude" to be two separate crimes for non-federal employees as it is the case for federal ones (In which case handling the issue would have been left up to the states)?
The majority opinion refused to consider the moral argument (although they snuck it in in their argument on a lack of fair notice), but IMO that's by far the most intuitive one, when you allow yourself to look at the problem from the legislative perspective. By looking at the extremes it becomes very clear that there are two very different problems:
Imagine a group of students doing much better than their peers on their final exam thanks to the efforts of their teacher and they gift him a "Best teacher ever" mug.
But now reverse the causality:
Imagine a teacher demanding to be gifted a "Best teacher ever" mug before putting extra effort into preparing his students for their final exam. The group that gifted him the mug does much better than their peers as a result.
IMO these should be two very different crimes, but there is also a valid argument that they are about equivalent, as pursued by the dissenting opinion.
But that's not something a court should legislate.