Knave comes from a word for a boy or male servant. A negative judgement attached itself to this social label, producing the later rogue or dishonest-man sense. The neutral and insulting uses did not switch over everywhere at one instant.
Sources
- Merriam-Webster · knave
The word’s etymology and recorded senses.
- Etymonline · knave
Additional context for the meaning or borrowing history.