A recurring pattern that I see in rock music is that it will often opt for higher frets while lower frets are available. For example, in this tutorial for Alice in Chains - Them Bones, the guitarist chooses to start the solo on fret 8 on the A string. Why couldn't he start on the equivalent fret 3 of the D string?
Off the top of my head...
- the fret spacing is tighter there, so fingering a fast passage may be easier than in the lower position
- the timbre of the notes is mellower and 'bluesier', which may be the desired effect
- open strings can sound different to fretted notes, so it can be desirable to avoid open strings.
- Muting technique is also different with open strings - you can't mute just by lifting the left hand finger. This is another reason to avoid open strings.
- string bends are often easier to control in the middle of the neck, rather than in the lower positions
- it's common to extend a note in a solo to a 'power chord', playing the fifth and the octave above - this is easiest to do when the power chord shape spans two frets only. If the root of the power chord is on the D or G string, the shape spans 3 frets.
First of all, there is more than one way to play almost any riff, solo, or musical phrase on a guitar. Unlike a keyboard instrument, the same note in the same octave can be played in multiple places on the guitar.
There are many reasons why a guitarist might choose one position to play a certain riff over another position. Sometimes it has to do with which direction the notes are going and by how much. It may be easier to get to the highest notes at the end of the riff by starting on a lower string at a higher fret and playing the higher notes on the higher strings - moving more vertically as opposed to horizontally.
There is also a slight tone difference that you get when playing the same pitched note on a fatter or thinner string and that can factor into the decision.
I think one reason you find rock guitarist opting to play solos in positions closer to the body is that rock guitar solos feature a great deal of string bending. It's easier to bend the string closer to the body than it is closer to the nut. Try it and you will see what I mean.
Also many rock solos end up on moving in an ascending pattern towards a crescendo or climax ending on some of the highest notes available on the guitar. It's a long way from the 3rd fret to the 22nd fret.
Having said that, don't be afraid to try different patterns on any given riff or solo to see what works and sounds best for you. Tab written by someone else is nothing more than a way to represent how they prefer to play it. It doesn't mean it can't be played another way or that their way is the only way (until you get to the higher frets on the first and second string) or even the best way!
The different positions of notes have a different tonality to them. Try listening to the same notes in different positions. The open string notes have a purity or clarity to them but the further you go away from the nut the more that type of effect is lost.
It may be a bit hard to explain but listen closely to the same notes in different positions they all seem superficially the same but if you listen closely you can hear they all slight character variances.
It may be a thing that the player would like to exploit.
To have a more tensed sound. When low instrument (or string) plays a high note - it will sound tensed. When high instrument (or string) plays a low note - it will sound relaxed. So - if a violin and a cello will play the same note - the violin will sound more relaxed than the cello.
I agree with most of what's been said, but I'd like to give an answer that is specific to that first bar.
The vast majority of the notes are A string 5th fret. Thus the music tenses on the notes played on the 8th fret and relaxes on the notes played on the 5th fret. Playing the notes on different strings sounds completely different (both because of the different tones of each string and also because the notes can ring at the same time), so that's out.
The other alternative is to shift everything up one string and down 5 frets. Then we have lots of 0's and a few 3's. Again, the brighter tone of the string and in particular the use of open notes completely change the character.
So in summary, you can play it elsewhere on the neck, but it won't sound the same.
Another thing to note is that the large number of notes on the 5th fret makes the fingering quite easy. The index finger does all the work on the 5th fret with the other fingers covering the higher frets, and it just feels very natural to play in that position.
The 5th fret is a very natural place for the hand to be. The frets are nicely spaced, not too far apart nor too close together. You also have room to be creative, as you have more frets below as well as above, that you can dive down to if you feel like throwing in a deeper sounding lick.
In Maria Maria by Santana you can see him stretch from the 12th fret to the 17th fret in this video. It's on the 1st (high E) string, so there isn't a lower fret fingering available, but anyway it shows there can be an advantage of higher frets. This stretch would be impossible on lower frets.