So if a guy doesn’t want to fulfill his leviric obligation, he gets spat at, loses a shoe, and gets a name attached to his family for posterity to remind everyone of this fact. This does not sound to me like a legal way to avoid one’s obligation, this sounds to me like a punishment for not fulfilling the (still mandated) obligation.
I didn’t want to get into that in the Staff Report. The ritual is obviously a combination of both. The idea is that, yes, you can get out of the levirite marriage, but to do so involved some public embarrassment and public acknowledgement. For the tribal life of that time, property remained with the family, and preserving the family was considered critically important. So, a guy could get out of marrying his sister-in-law, but it wouldn’t be easy.
OTOH, presumably, if Onan had known of this approach, he would have preferred being spat at to just dropping dead.