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".
scifi.stackexchange.com/users/98382/Chronocidal
According to Pablo Hidalgo of the Lucasfilm Story Group in this Youtube video the clone troopers were replaced with volunteers who were 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.
scifi.stackexchange.com/users/31936/Null
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.
scifi.stackexchange.com/users/68913/EvilSnack
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.
scifi.stackexchange.com/users/100321/Knox Boyd
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?
scifi.stackexchange.com/users/1032/jwenting
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?
Why did people enlist in the Imperial military?
scifi.stackexchange.com
<star-wars>
scifi.stackexchange.com/questions/201585
scifi.stackexchange.com/users/90310/Boolean
There is no one answer to this question, but there are number of reasons that people would enlist in the Imperial military, depending on the time frame. Firstly, a number of storm troopers were people who were fiercely patriotic and loyal to the Empire and then many storm troopers were kidnapped as children. Additionally, for storm troopers on Star Destroyers and the Death Star, life was pretty good and they received a uniform and protection for their families. Finally, storm troopers would not necessarily have seen themselves as 'evil'. According to  Pablo Hidalgo of the Lucasfilm Story Group, the stormtroopers were fervently patriotic and loyal to the Empire, but they may also have been motivated by anti-rebel propaganda and by the status and good living conditions they enjoyed in the army.
For the people on the ground it was the Empire that was good and the rebels that were evil and so people wanted to sign up to fight the rebels and protect their homes. According to  Pablo Hidalgo of the Lucasfilm Story Group, the stormtroopers were fervently patriotic and loyal to the Empire.    A lot of the Stormtroopers were kidnapped as children and raised/brainwashed into their roles. The stormtroopers enjoyed a fairly good standard of living on the Death Star and were much respected when going on leave back home. Also they did not know the Empire was evil. The rebels are seen by most Imperial citizens as a terrorist group so it is a good thing to fight against them.