I like both movies (one more than the other) but the reason one gets dogged on is because it altered and messed with an established franchise and missed the point. The Avengers stood true to the characters and heroes even down to their costume designs (Hawkeye excluded). And after several films building up to it (in what was the first of its kind in film and a major gamble) it lead to a massive payoff that does have a plot (though simple) and where the heroes were the stars of the show. It does look like a dumb action movie with little plot on the surface, but it becomes a lot deeper and has more meaning when we put the previous films in the MCU into consideration.
Transformers on the other hand hardly focused on the title characters. The film is usually divided into two plots: the first half being a teen romance drama, and the second half being military action film, all with some giant robots splintered in there. Michael Bay once implied in an interview that he doesn't like the Transfomers franchise and at times it does show. And it's also clear that he really likes the military, so he often substitutes the robots for more military ****. And in the end, it all begins to look like a cash grab, especially when Paramount goes out of their way to get Bay back for the 4th film.
So we have one film made by guys who know and love the source material and want to remain faithful to it, versus a film headed by someone who has admitted to not liking the source material that it's based on. Which one do you think is going to go over well with fans and critics?
For the record people usually agree that the first TF is the best in the series. The real criticism doesn't start until you get to the sequels.