Most eukaryotic genes contain introns and you usually don't know how they are spliced without their mRNA. This is the reason you need to extract the full-length mRNA and generate cDNA for gene cloning and expression. For prokaryotic gene, they do not have introns so you can directly clone the DNA coding sequence for protein expression.
As DNA have both introns and exons and you dont know how the introns are spliced, Thats why you need full length mRNA and than synthesize cDNA for expression purpose.