To expand a bit on jamesqf's answer, while the airlines decide much of the interior layout, window placement is driven by structural elements of the aircraft. An airliner fuselage has a series of circular frames, and windows go in the gaps between these frames:
You can't really change the window alignment without changing frame spacing, and doing that is a major airframe modification that requires regulatory approval. So long as airliners are built with this basic structure, you cannot easily change window spacing on the same type. Furthermore, structural demands dictate that window spacing is going to be completely uniform, like the frame -- even if airliners came from the factory with a fixed seat layout, you'd have trouble aligning all the rows of a multi-class cabin (your business/first class would need seat spacing to be an integer multiple of the spacing in economy). It's not just that you can't change windows when you change seating, it's that window spacing basically must be identical and uniform on all aircraft of a type.
While it may not be great for UX to have misaligned windows if all else were equal, it's the natural result of this structural design dictating uniform window spacing and other concerns (e.g. fitting as many people as possible, having more legroom in some seats without having to give them too much more) dictating non-uniform seat spacing. You could align them if you have few seats and can align seats to windows, but that leads to inefficient use of space in the plane.