Why are prostitutes called hookers?

During the Civil War, a Union general named Joseph "Fighting Joe" Hooker
decided to increase morale by allowing prostitutes to have access to his
troops. The prostitutes who frequented his headquarters became known as
"Hooker's Girls."

When a section around Washington was set aside for brothels, it was
called "Hooker's Division" and the prostitutes themselves were called
"hookers."