Well, the answer is of course convention. West Country is comic in the same way that English RP is the speech of suave villains, and these things become self-perpetuating. (When did that villain thing start, though? Basil Rathbone, perhaps? Or does it go back to colonial times? I assume the practice of using English actors to play Nazis in war films did a lot to entrench it.) Nor is it just a matter of accents. When did you last hear a woman do the voice-over for a film trailer? If the answer is anything other than 'Never', we've been going to different cinemas.
Okay - but the West Country thing is far older than Hollywood. In one sense, it's just a particularly virulent strain of the age-old contempt for people from the country on the part of city dwellers. The countryside is the place where naifs and bumpkins come from, to be taken advantage of by canny city crooks, from Wycherley back to Middleton and Jonson. The very word "clown" originally meant "rustic", of course - although the connotations of stupidity and crassness were there from the first (the word seems to be etymologically related to 'clot', as in a lump of clay).
But why that particular part of the country? Why the West? For Wycherley and others in the Restoration, Hampshire seems to have been the bumpkin territory of choice. Hants is I suppose on the borders of the West country (at least the part I come from, the New Foresty bit), but at the north-east end is pretty much in the commuter belt. Its relative proximity to London may have been an advantage from the dramatists' point of view, as might its reputation for pig-breeding. ("Hampshire born and Hampshire bred, strong in the arm and thick in the head," is a rhyme I heard when young, but have since seen applied to other counties.)
The earliest text I can think of that seems to target the West particularly - or seemed to when I read it as an undergraduate - is Gammer Gurtons Needle, where the hapless rustics say things like "cham" (short for "Ich am") instead of "I am". I parsed that as West Country at the time, and indeed on checking the OED just now I see that that form survived longest in south Somerset (into the early nineteenth century), but that's not to say it wasn't to be found elsewhere when GGN was written in the 1570s.
Francis Drake and Walter Ralegh, strongly accented Devonians both, seem to have done nothing to dispel the "West Country"=bumpkin association. But seafarers in general, and pirates in particular, are a curious exception to the rule - there, West Country accents are fierce and threatening! Why should this be? (Isn't Darth Vader just a space pirate, when all's said and done? Or at any rate, a space privateer like Drake, since he's under orders from the Emperor.)
According to his Wiki page, Prowse was nicknamed "Darth Farmer" by Carrie Fisher and the others on the Star Wars set - but in fact he's not from the country at all. At half a million, Bristol has a population more than ten times the size of Fisher's own hometown of Beverley Hills, which is of course famous mainly as the residence of a comedy bumpkin named Jed Clampett. Oh, the irony.