There are two kinds of common 11-speed Shimano hyperglide cassettes.
The first type of cassettes, "MTB", has a big sprocket that is large. The big sprocket is shaped so that it overhangs the right hub flange, which is only possible because the sprocket is large. You can use this type of cassette directly on Shimano 8-10 speed "road" hubs and Shimano 8-11 speed "MTB" hubs. If you install this type of cassette on a Shimano 11-speed "road" hub, you need a 1.85mm spacer.
The second type of cassettes, "road", has a big sprocket that is small. Because of this, the big sprocket cannot be shaped to overhang the right hub flange. Thus it needs a wider freehub body and a hub where the right hub flange is closer to the centerline of the hub, offering more space for the cassette. You can use this type of cassette only on Shimano 11-speed "road" hubs. 8-10 speed "road" hubs and 8-11 speed "MTB" hubs won't accept this cassette.
Additionally some 10-speed "road" cassettes with an aluminum spider require a 1.0mm spacer to be usable on a 8-11 speed "MTB" hub or a 8-10 speed "road" hub (and you need 1.0mm + 1.85mm spacers to use them on 11-speed "road" hubs). These cassettes are rare.
Any 8-10 speed cassette requires the 1.85mm spacer to be usable on a 11-speed "road" hub.
So, to answer the question: the 11-34 cassette is a "MTB" cassette and the 11-28 cassette is a "road" cassette, so the old cassette required the spacer but the new cassette doesn't, because apparently your hub is a 11-speed "road" hub. Store the spacer somewhere safe so that you can find it again should you need it in the future.