That's because Azurill doesn't evolve from max affection, it evolves from high friendship!
>Azurill evolves into Marill when leveled up with high friendship, which evolves into Azumarill starting at level 18.
Affection and Friendship are completely different things.
>In Generation VI, friendship is not to be confused with Pokémon-Amie's affection. Affection is an entirely separate stat having no bearing on friendship, and no actions taken in Pokémon-Amie will affect friendship in any way.
Here are all the ways you can increase a Pokémon's friendship in Generation VI:
† These include Pomeg Berry, Kelpsy Berry, Qualot Berry, Hondew Berry, Grepa Berry, and Tamato Berry.
Azurill will need to have a friendship value of at least 220 or higher for it to be able to evolve into a Marill.
Once it has a friendship value of at least 220 or higher, you have to level it up one level and it should evolve into a Marill.
Source: 1 | 2