1. Taxiways have classifications so operators know which aircraft will fit onto them. As long as the aircraft's nose wheel tracks along the line the main gear will not go off the edge of the taxiway on corners.
2. In low visibility operations or night operations it may be difficult to locate the taxiway while on the runway. If you have a line going from the centre of the runway to the taxiway it's easier to find.