Hi @rnaFan,
since miRNAs are ~22nt in size, the average mapped length of 21.6 makes sense.
The read sequnces are longer because they contain adapter at the 3' ends.
It's best to trim those adapters before mapping, but since you did not do it, STAR is trimming all the bases it cannot match to the genome.
If you use EndToEnd option, most reads will be unmappable.
To trim adapters before mapping, you can use external trimmers, or STAR's internal trimmer with
--clip3pAdapterSeq <AdapterSequence> --clip3pAdapterMMp <MismatchPercentageInAdapter>
AdapterSequence should be the first bases of the adapter, I typically use ~10, MismatchPercentageInAdapter ~<0.1
After trimming you can use EndToEnd option.
Cheers
Alex