Railroad gauge went to a standardization because the built rails soon met. A standard rail will make it easier for trains to go across from one rail to another. Engineers before used different gauges which would not fit be correctly fit and would be difficult if the rails were all different.
It was a costly project but was a necessary move for easier and fast transportation.