Why was the Dakota Territory divided into North Dakota and South Dakota?

It was a suitable way to divide up the Territory into appropriate state sized parcels.

The Dakota Territory would have been too large to effectively govern considering the nature of transportation in 1899.

Also, there was intense rivalry between the business interests that focused on each railway that was built across the territory. One ran through what now is North Dakota, the other ran through what now is South Dakota. They did such a good job of disagreeing that eventually they separated the territory into two separate states to settle the feud.

One major reason for the separation was to gain representation for the region in national politics. If the Dakota Territory were to have simply stayed as one state there would have been 2 Senators (vs 4 currently) and 1 House Rep. (vs 2 currently).

North Dakota and South Dakota are parts of land acquired in the Louisiana purchase. They ended up as two distinct states due to a political conflict at the time statehood was announced that related to the building of the transcontinental railway. See the attached link.