Apart from the obvious fact that the Empire wanted to replace clone troopers with human troopers, why would one enlist in the Imperial military? Was the pay good? Did they get good work benefits?
You're looking at this from an outsider perspective, with clearly signposted "Empire = Evil" (especially if you watched the Original Trilogy first)
For the people on the ground, the Galactic Empire isn't an "Evil Replacement" for the Galactic Republic - it's a rebranding.
You have Supreme Chancellor Palpatine, who not only led the Republic to victory over the Separatist Confederacy, but also persuaded several of the systems to re-join the
Republic Empire after the war. He did so under Emergency Powers - never abusing those powers (after all, he could just arrange for Count Dooku to make a targeted attack that coincidentally allows him to push his own agenda), but purely using them to cut through Red Tape to ensure that what needed to be done got done in a timely manner. He also let the Senate run largely as it did before Emergency Powers were enacted, listening to their advice - although, as seen in The Clone Wars series, anything that is left purely to the Senate tends to take far too long to be effective. It's for these reasons that the Senate decide it's worth making the arrangement permanent, and reward him with the position of Emperor. (Think of any "4 more years" calls for a popular President to be given an extension on Term Limits - then imagine that 90% of the Population were all calling for it. Such a pity it quickly went from "noble leader with advisory senate" to "evil despot with ignored senate")
Next, you have the Rebels. Well, the
Republic Empire just finished fighting the Separatists - these are clearly (read: "not at all") just the more militant members, who refuse to surrender and were giving their peaceful brethren with legitimate grievances (who have since re-joined the Republic Empire) a bad name. We wanted to defend our homes against them before, but the Republic Army was made of Clones to help protect the Citizens from harm. Now that the war is over, Clone production is being ramped down for both Ethical and Economic reasons - so there's an opportunity for all these people who were itching to protect their homes and family to sign up and do so!
The Empire also have control over a lot of the media, so they can choose to paint the Rebels as "bad" and the Empire as "good" - there's a lot of this visible in the Star Wars: Rebels series.
If you want an in-and-out of universe example, go play the old Star Wars: TIE Fighter games - they did a pretty good job of making being a member of the Imperial Navy feel like the "good guy" option, protecting loyal citizens from the terrorist acts of the so-called "Rebels".
fervently patriotic and loyal to the Empire.
Therefore at least some recruits to the Imperial military joined out of patriotism, loyalty to the Empire, and a desire to see the Empire succeed. Others probably joined because the pay and/or benefits were better than the pay they could have received elsewhere, for adventure (e.g. to get off their boring homeworld and travel the galaxy), etc. -- basically, all the reasons anyone in the real world might join a military organization.
This depends on the time frame. Post-original trilogy, a lot of the Stormtroopers were kidnapped as children and raised/brainwashed into it.
We can also get a clue from the mostly-forgettable Solo film, which depicts Han's home world as one of the trope-typical SF worlds in which everyone but the elites lives in squalor. A lot of people in that circumstance would join up because they want to earn some kind of living in a more-or-less legal way.
For troops on Star Destroyers and the Death Star, life was actually pretty good, and most stormtroopers were greatly respected when they went back home from the their tour. Lastly, and most importantly, they did not know that they were evil. They were told that the rebels were terrorists, and joining would help stop the 'terrorists' from bombing their cities and villiages. They got away with this because some of the more violent rebels actually did that. They were not told the awful things that the Empire did.
The rebels aren't the nice guys, to the average Imperial citizen they are a terrorist group intent on destroying their way of life, upsetting the economy and killing people at random everywhere.
They're the scum of the galaxy, criminals, murderers, smugglers, and the Imperial Navy is hard at work putting them down.
Join up NOW, do your part to defend the Empire against enemies foreign and domestic.
Decent pay, your family looked after in case you lose your life, a fancy uniform that the girls will swoon over, what's not to like about this job?
At a general level, the question can be answered by looking at the real world and history: why do soldiers go to war? And you'll find that the answers are the same from the ancient past to the modern day:
- Conscription of some kind (everyone is expected to fight, whether legal or cultural)
- Peer pressure
- Family/community tradition
- Increased personal opportunity (education/training/connections/etc)
- Impress others
- Escape from personal situation
- Reward seeking
- Belief in the cause
- Socially accepted outlet for socially unaccepted behaviour
Any soldier can be motivated by one or more, and quite often "Belief in the cause" can be near the bottom of the list of reasons. It's the one that gets the most propaganda, but in terms of actual reasons it tends to be toward the bottom.
To put it simple as possible, you have 2 sides Good and Evil, both have the power of The Force. Think of the society we live in, and the way the government is in control, well they are the Empire, they have a great following of people who believe that the Emperor is a great person who will give great things for the followers of the Empire, just like our government do and the monarchy.
Now, the Rebels basically consist of freedom fighters who understand that the Empire is an evil force following the evil side of the Force, who wants full control of the galaxy and further the universe and everybody who follows the Empire but really the people are being brainwashed to believe that the Empire is actually a good following, just like our government and monarchy.