If you are flying an aircraft for pleasure, it is certainly allowed to take photos. There is no rule against it. A good pilot does not allow anything to distract them when the right thing to be doing at a particular moment is aviating, navigating, or communicating.