7-speed MTB cassette on 8/9-speed wheel hub, where does spacer go?
A spacer to convert an 8/9 speed freehub to  7 speed freehub goes behind the cassette, between the hub shell and the cassette. Most cassette lock rings will not bind on the spacer, they will go inside it if you place it on the outside. 

In addition, the aluminum used in most cassette spacers is too soft, and would compress under direct compression from the lock ring. It would not stay tight.

Hope that helps.