The original meaning may have come from baseball.
A form of tennis has been played by Englishmen at least since the time of Henry the Eighth of England in the sixteenth century. It probably came to court from France. In the early days lines were drawn to establish the boundaries of the court. By as early as the middle of the eighteenth century the idiom, "to draw a line" was used to mean establishing a limit for something. Also, this may have been derived from the lines drawn for the space between opposition parties in Parliament, so as to put an end to injuries from sword fights.