Array along a 3d curve with rotation lock on certain axis
To duplicate an object without deformation and with a constraint on its Z axis, use Dupliframe:


Build your bezier curve, and, in Edit mode, make sure that it goes in the right direction, if not: select all and W > Switch Direction
Put the origin of your bezier curve at it starting point
Put your object at the same point
In the Data menu of your bezier curve, click Path Animation, then in Frames choose the amount of duplications that will happen. Enable Follow.
In the Object menu of the object you want to duplicate, in Duplication, enable Frames and unclick Speed.
Parent your object to your curve with ctrl P > Object.
Keep your object selected and go to Constraints, choose Limit Rotation, and click X and Y, unclick Z.


It should work