Some are wearing them in jest. Others sport them sincerely.

But whatever their motivation, teenagers across the country have been going wild for shirts that bear a chaste declaration: “Virginity Rocks.”

The clothing items became popular online thanks to a social media influencer and are now stocked by a major retail chain with a presence in malls across the United States. The trend has puzzled some school administrators, who have banned the shirts only to face criticism, and other adults, who have wondered if youth abstinence is on the rise.

It can be traced to Danny Duncan, a 27-year-old YouTube personality and prankster, who said he started wearing “Virginity Rocks” shirts in his videos as something of a joke in 2017. Mr. Duncan said that his use of the phrase was “tongue in cheek,” and that most people wore it humorously. But, he added, he is proud to have seen it catch on with young people who champion abstinence.

“I have sex, obviously, but I want people to do whatever they want to do and not be pressured into anything,” Mr. Duncan said. “I sell ‘Practice Safe Sex,’ too, which could be funny but is also a positive message at the end of the day.”