Actually, it's either "bum rap" or "bad rap," not "bad wrap" or "bad rep". "Wrap" has no suitable definition that would make sense, nor has a connection in the phrase been found by the people behind the Oxford English Dictionary (OED), and "rep" is short for reputation. Bad reputation implies either some truth behind one's reputation or a collective opinion or summation about someone's reputation. Neither are applicable here.
The phrase originated as "bum rap," which, according to the OED online, is slang that originated in the United States. Bum rap, according to OED, means "1) a false charge or conviction; an undeserved criminal punishment, and/or 2) an instance of unjust criticism or undeserved blame".
The OED has also traced the etymology of the first definition to a June 5th, 1913 edition of the Chicago Daily Tribune ("They'll frame a ‘bum rap’ on me before I've been out of stir a week") and the second definition to September 30th, 1921 (Poor Tommy O'Connor got a bum rap for the time being). If you don't have OED access, Chicago Magazine talks about it with less detail here:
http://www.chicagomag.com/Chicago-Magazine/July-2010/Top-40-Chicago-Words-Our-Contributions-to-the-English-Language/The OED traces the definition of "rap" ["A criminal accusation; a charge. Freq. with modifying word (see also BUM RAP)] in this sense to Hutchins Hapgood's 1903 Autobiography of a Thief ('What makes you look so glum?’.. ‘Turned out of police court this morning.’ ‘What was the
rap, Mike?’ ‘I'm looking too respectable. They asked me where I got the clothes.') and Merriam Webster shows how bum rap and bad rap are interchangeable:
b : a negative and often undeserved reputation or charge —often used with
bum or
bad <given a bum
rap by the press> (
http://www.merriam-webster.com/dictionary/rap).