Generation of the male gamete; specialised haploid cells produced by meiosis and along with a female gamete takes part in sexual reproduction.