I don't know if this helps but let's say you have a platform from 0 80 0
to 10 80 10
(centre is 5 80 5
). If you would want for example a creeper to be randomly summoned on one of the blocks this should work. Set up a command block that summons a creeper with the tag {PersistenceRequired}
(this makes it so the creeper won't despawn) like this:
summon minecraft:creeper ~ ~2 ~ {PersistenceRequired:1b}
(I did ~2 so it spawns on top of the chain command block that will be placed above it)
then a chain command block which spreads the creeper on your platform:
spreadplayers 5 5 0 5 false @e[type=minecraft:creeper,distance=..3]
the first 5 and second 5 are the x and z coords, 0 is the minimum distance between entities (only applies if 2 or more entities are affected by this command at the same time, the third 5 is the distance from the centre you want the entities to spread (it's a square). If you want a "custom shape" you can place water above the block you don't want the creeper to spawn on, just make sure the water is the top block above the block you don't want the creepers to go, now onto the initial question: separate y levels, this is easily done by using
spreadplayers 105 5 0 5 under 81 false @e[type=minecraft:creeper,distance=..3]
This will teleport the creeper to the top block under y=81 however with this you can't place water 50 blocks above the platform for a custom shape anymore with water, but if your under y coord is set directly 1 block above the platform you can place string on places you don't want them to spawn, this however might be annoying since it's in the way. There is probably a work around for this but I feel like there is enough stuff here. I hope this helps at least someone checking this question looking for a good answer