Why did we call it digital signature if an attacker can pretend to be Bob?
Bob hashes his message, encrypts the hash with Alice's public key, and sends it to Alice with the original message. Alice receives that message and the signature. She decrypts the signature with her private key, and compares the outcome with the hash of the message.
But why did we call it a signature if a hacker can do what Bob has done?
A hacker can also hash his message, encrypt the hash with Alice's public key and send it to Alice. Sorry guys but digital signature seems similar to asymmetric encryption to me, a hacker can also pretend to be Bob.