In order to use the Y spline in this way you need to pay attention to its local
coordinate system. The Y spline uses the path's local Y axis for the height or the array and the X axis to deform the path. The Z axis is ignored.
This means that if you create the spline in the front viewport you may not get the results you're after unless you rotate the spline by 90 degrees. The easiest way to ensure the spline aligns correctly is to create it in the Right viewport or create it in the top or perspective view and rotate it into position.
I hope that helps, please let me know if you have other questions.