Here are two factors to consider, which would determine why a player would decide on an open string, v/s a fretted note.
Convenience - If the passage you are playing is fast, you won't have time to move to a less convenient part of the neck. If speed is not an issue - it could be that it's simpler to allow the note to ring open than to move your hand.
Tone - Each note played in different positions has a different timbral quality. Listen to the same note played at every possible position on the neck. They all sound unique. An open string can also ring, while a fretted note will only sustain as long your finger is applied.
Adding to Tim's answer below: playing an open string with vibrato can be achieved by moving the hand you use to fret the note behind the nut at the top of the neck. Jimmy Page uses this technique when playing Black Mountain Side in a live Led Zeppelin video. Pretty cool technique - but more effective for showmanship than practicality.