A misdeed is a type of bad behavior, especially behavior that's immoral. If you get caught stealing someone’s lunch, you’ll be punished for your misdeed.
A deed is an action, and a misdeed is a specific type of action. It’s one that's wicked, unethical, illegal, or just plain wrong. It’s the opposite of a good deed. Cheating on a test is a misdeed. So is cheating on your spouse. Stealing is a misdeed, as is any other crime. Politicians get caught in scandals when their misdeeds are discovered, such as lying or taking bribes. It’s from the Old English misdæd for "sin, evil.”