The purpose of the illustration that you linked to is to sell books. As you can see, the illustration is from the cover of a dime novel (cheap, sensationalistic fiction as opposed to "real" literature). A publishing company will only put something on the cover of a book if they think the illustration will help to attract people and make them want to buy the book.
So the more important question here is why the publisher thought that that illustration would help the book sell. The answer there is that the illustration taps into the sort of fears that people had back in those days. In the present, we have TV shows and movies with trailers and ads that play on our current fears (terrorism, crime, etc). So it was in those days. There was a fear of Chinese immigrants and their supposedly lawless ways. Because of this, a book that featured Chinese criminals (and which showed them on the cover) would be likely to sell, just as a show about someone fighting terrorism is likely to do well today.