Perform same action on all selected objects
As you noticed, bpy.context.object points to the active object, regardless of the variable in your for loop.
In your last line you are iterating over all selected objects, but you are not actually using the iteration variable afterwards, cube.
Replace the last line with print(cube.scale[0])