It's complicated and I don't know the full history, but the reason it's 625 lines is so that the horizontal refresh rate is approximately the same as for NTSC, allowing monochrome sets to be relatively easily converted. Also, 625-line television was developed at roughly the same time as early colour but I'm not sure they necessarily arrived at the same time depending on the country.