Why did Death Valley dry up?

Death Valley has a subtropical, hot desert climate with long, extremely hot summers; short, mild winters; and little rainfall. The valley is extremely dry, because it lies in the rain shadow of four major mountain ranges

Is there a shore or river in death valley before why it dried up?

There was history of a passive margin developed on the edges of these new seas in the Death Valley region. Carbonate banks formed on this part of the two margins only to be subsided as the continental crust thinned until it broke, giving birth to a new ocean basin.