.They are non-infectious and a natural occurrence on the body. Masturbation has no relation to it.
For pearly penile papules ablation using carbon dioxide laser, electrodesiccation with curettage, and excisional surgery reportedly have successfully eliminated lesions.Pls discuss these treatment options with a dermatologist.
Hope it helps. Take care and pls do keep me posted on how you are doing or in case you have additional queries. Kind regards.