The main reason the ditch holds water is insufficient slope on its bottom. Water accumulates in the flat area of the ditch and remains until it evaporates. You can easily correct this by excavating and reshaping the ditch to slope in the direction you want the water to go.
If there is no direction that's adequate to slope the ditch, the other option is to install perforated drainage tile. This moves the water from the ditch, underground, where it can percolate back into the soil. It's installed by digging downward-sloping trenches from the ditch into the surrounding soil, installing 4-inch perforated drainage tile in the ditches and backfilling them. Don't install the drainage tile toward the house; this encourages movement of water into the basement.
The type of soil in the ditch and surrounding land affects how quickly water can percolate back into the ground. If the soil is hard packed clay or contains a high amount of organic content, the soil will drain extremely slowly. A sand or gravel base allows surface water to re-enter the ground quickly.
A French drain is basically a large hole filled with gravel. You direct the water in the problem area to the French drain, where it can percolate back into the ground. The size of the French drain is determined by the amount of water generated by the largest annual rainfall and soil conditions. It's wise to build a French drain much bigger than you anticipate to accommodate those rare heavy rainfalls. It should be located at least 20 to 30 feet from the home to prevent moisture from making it back to the foundation.