EDIT: I'm looking for backup to the claim that sunlight provides something that you don't get in a vitamin D3 supplement. It seems reasonable but has a big impact on the solution.
------
Vitamin D3 (cholecalciferol) is produced industrially by exposing 7-dehydrocholesterol to UVB light, followed by purification.[143] The 7-dehydrocholesterol is a natural substance in wool grease (lanolin) from sheep or other woolly animals. Vitamin D2 (ergocalciferol) is produced in a similar way using ergosterol from yeast or mushrooms as a starting material.[143]
Tl;dr of 5 types & only D2 and D3 are commercial avail
--Wikipedia: http://en.wikipedia.org/wiki/Vitamin_D
Leaving aside any other ill-understood benefits of sun exposure.
There are other reasons to sunbathe (e.g. NO release) but there is only one active form of D.
The obvious fact is that we evolved to live under at least some sun exposition (depending on your genetic background), trying to replace that entirely with pills is backwards.
It's very seductive to argue from an evolutionary advantage perspective. It can be used to generate Hypotheses that need testing. But one shouldn't give health advice based on it. After all we brush teeth, wear clothes and benefit massively from machines and modern medicine.
It's about sane defaults. The effort to validate every reasonable hypothesis is extraordinary, and sometimes impossible. We can't afford to live our lives based only on what conclusions science has been able to come to so far. Making some choices based on ancestral norms is perfectly acceptable and better than many alternatives.
Then you don't have to follow that complicated evolutionary logic style thinking. (I know it's very trendy right not) In the end Nature isn't smart and can't think.
That said you're probably better off getting it from catfish or salmon (which also contain omega fatty acids, a "good" fat which you might otherwise consider supplementing if you aren't getting enough in your diet)
And of course it's not a dichotomy, you can supplement D3 daily and also try to eat a lot of fish!
Vitamin D supplements consist of (mostly) one type of Vitamin D. People are typically deficient in that specific type so mild supplementation is a reasonable option. Just don't kid yourself into thinking that taking Vitamin D is a replacement for spending adequate time outdoors. Compared to the first 100 million years of our species existence, hiding indoors all day is a relatively new invention. It will be a while before science produces a silver bullet in gelcap form.