Tony Allen plays on a good defensive team.
Tony Allen had to play on a team where the middle was manned by Raef LaFrenz and Mark Blount, and his defense didn't seem to suffer.
Tony Allen defensive rating 2004-05 to 2006-07: 104, 106, 104
Tony Allen defensive rating 2007-08 (year KG came to town): 99
Tony Allen defensive rating 2013-14 (with M. Gasol behind him): 101
http://www.basketball-reference.com/players/a/allento01.html#per_poss::none
You realize that the BR individual defensive "ratings" are practically useless, right? According to them, Eddie House is as good was Tony Allen defensively (he notched a rating of 100 in 07-08).
Considering House was part of one of the greatest defensive teams ever and had his defensive shortcomings hidden by KG/Perkins, this is not surprising. In each of the two years before coming to Boston, his defensive rating was 108. In the 50 games he played for Boston in 2009-10, 107. Then in the 18 games he played for the Knicks the same year, 113. 100 is the lowest defensive rating House ever posted.
If you are dissatisfied with such a statistic, consider some others. Tony Allen's defensive box plus minus in his first three years combined (before KG) was 1.8. When KG came to Boston, he posted a 1.9 DBPM in a single season (2007-08).
In his first three years, he averaged about 1.2 defensive win shares per year. In 2007-08, this number jumped up to 2.8.
In each of his first three seasons, his +/- per 100 possessions was: +7.0, -2.4, -2.1. With KG in 2007-08, this number jumped up to +9.8.