Endoribonuclease that plays a central role during spermatogenesis by repressing transposable elements and preventing their mobilization, which is essential for the germline integrity (By similarity). Plays an essential role in meiotic differentiation of spermatocytes, germ cell differentiation and in self-renewal of spermatogonial stem cells (By similarity). Acts via the piRNA metabolic process, which mediates the repression of transposable elements during meiosis by forming complexes composed of piRNAs and Piwi proteins and govern the methylation and subsequent repression of transposons (By similarity). During piRNA biosynthesis, plays a key role in the piRNA amplification loop, also named ping-pong amplification cycle, by acting as a 'slicer-competent' piRNA endoribonuclease that cleaves primary piRNAs, which are then loaded onto 'slicer-incompetent' PIWIL4 (By similarity). PIWIL2 slicing produces a pre-miRNA intermediate, which is then processed in mature piRNAs, and as well as a 16 nucleotide by- product that is degraded (By similarity). Required for PIWIL4/MIWI2 nuclear localization and association with secondary piRNAs antisense (By similarity). Besides their function in transposable elements repression, piRNAs are probably involved in other processes during meiosis such as translation regulation (By similarity). Indirectly modulates expression of genes such as PDGFRB, SLC2A1, ITGA6, GJA7, THY1, CD9 and STRA8 (By similarity). When overexpressed, acts as an oncogene by inhibition of apoptosis and promotion of proliferation in tumors (PubMed:16377660). Represses circadian rhythms by promoting the stability and activity of core clock components BMAL1 and CLOCK by inhibiting GSK3B-mediated phosphorylation and ubiquitination-dependent degradation of these proteins (PubMed:28903391). {ECO:0000250|UniProtKB:Q8CDG1, ECO:0000269|PubMed:16377660, ECO:0000269|PubMed:28903391}. This is the function of Ensembl gene identifier ENSG00000197181 (PIWIL2, piwi like RNA-mediated gene silencing 2).