The book was a very enjoyable piece of non-fiction and was really about a pivotal event that kicked off the creation of the FBI as we know it today.
The movie... well Scorsese loves to take historical novels and then... just make shit up so it aligns with whatever moral allegory he wants to tell.