No, but establishing a motive can help the prosecution prove its case.
Motive is often confused with "mens rea" (pronounced menz RAY-ah). Mens rea means "guilty mind" and refers to the defendant's culpability or intent to commit the criminal act. Motive is the term used to explain why a person committed a crime.
Mens rea is an element of just about every crime and requires the prosecution to establish that the defendant intended to commit the criminal act. (Sometimes it's enough to prove that the defendant didn't act intentionally but, rather, was reckless or criminally negligent.) But motive usually isn't a criminal element—the prosecution doesn't have to prove the defendant had it. Instead, prosecutors try to establish motive in order to convince the jury that the defendant is guilty.
Example: Johnny and June have been happily married for 30 years. Johnny is diagnosed with a terminal illness and is in constant pain. After living in agony for several months, he repeatedly asks June to kill him. After much deliberation, June shoots and kills Johnny. June's intent was to kill. Her motive was to stop her husband's pain. She's guilty of murder even though her motive may have been compassionate.
Example: Rob is on trial for theft by larceny. The prosecution has to prove that he took someone else's property while intending to permanently deprive the owner of it. Rob claims that he took Joe's wallet so he could have it cleaned—then he was going to return it. In order to show that Rob intended to keep the wallet for his own purposes, the prosecution offers evidence that Rob has a drug habit that he's had trouble financing.