According to this article, a recent Colorado aircraft accident was caused, at least in part, by the pilot taking selfies while flying the plane at a low altitude. In other flights, the pilot texted while flying as well.
Obviously, when flying an airplane, there are many dynamic inputs a pilot must take into account. A pilot must fly with both hands and feet, listen to the radio that includes conversations of other people and occasionally directions or inquiries of him/her, manage the aircraft and it's systems and think about what the next few minutes will need as it relates to all of those inputs. It really is a multi-tasking environment to fly an airplane. Introducing other distractions is simply a recipe for an accident.
That said, it's totally understandable why pilots want to share their views of the world with the world. It's a unique and beautiful perspective they have. In this article, photos are highlighted and compared to the sterile cockpit rule. The sterile cockpit rule is a common practice among commercial pilots that prohibits any activity unrelated to piloting below a certain altitude. The article does a great job of explaining the rule and how it correlates to the unfortunate reality that the time the pilots are supposed to be completely focussed on flying is also the most photogenic time of the flight.
In the near future, I imagine articles will soon discuss passive cameras role in the cockpit. Imagine strapping a go pro to your windshield or dashboard and every moment being recorded. It requires no input on the pilot's part to take the same photos or videos that can be easily accessed after the flight. At the same time, the cameras are designed to withstand serious impact. In the unfortunate even of an accident, as in Colorado, it's possible the camera would record conditions of the flight that help accident investigators accurately reconstruct the scene and determine the cause of the accident.