How do I make the cubes up and down on the y axis following the curve and without rotating? How do I make the cubes up and  down on the y axis following the curve and without rotating with the same space distribuition?

I used beziercurve and clamp to do this.
Use AddObjectConstrain>>ClampTo.