As you have noted in your comments, internal faces create an anomaly in the normals of the external surface, in both cases. It's less apparent where the Subdiv is before the Curve.
The Curve deforms the array of elements. In a polygonal modelling system, it can do this only by moving vertices to conform to the curve. If the displacement is made before the subdivision, only the ends of the box-elements are available to be deformed, and so the curve is approximated by element-length straight-line segments. The Subdiv. then subdivides those.
If the Subdiv comes first, there are more vertices available for Curve to deform. Now the curve is approximated by [element-subdivided] length straight-line segments, which are shorter, and approximate the curve more closely. In particular, the normals at the ends of adjacent elements are more alike, and so the joins look smoother.
- Get rid of the internal faces: you can cap the ends after applying the Array and Curve modifiers, or set caps on the array as suggested by MVB
- Manually subdivide the box in its length before deforming, or just make the elements shorter.
- Use a profile: (a rectangular curve,) as a Bevel Object for the sweep curve itself, (in its own Data tab, Geometry panel,) rather than arraying a mesh down it.
BTW, you may save yourself a lot of trouble by Ctrl A applying the scales of your curve and box, before going further. (You would also then have to reset the radius of the curve to 1.) While modelling, always scale the mesh in Edit Mode, rather than the object in Object Mode, (or apply the scale as soon as possible.)