Selfies, long derided as a symbol of narcissism and oversharing, have found a more serious purpose.

Companies and government agencies—ranging from the ride-hailing service Uber Technologies Inc. and credit-card giant MasterCard Inc. to the Alabama Department of Revenue—are asking people to snap self-portraits on their smartphones as proof of identity.

As...