When we judge something "on its own merits" we only look at that one thing and consider only what we know about it from our examination. We don't judge it based on what other people think about it or compared to other similar things that have already been judged or taking into account unimportant details that may bias our opinion of it.
For example, let's say that my dog Fluffy is competing in a dog show. She is the daughter of the grand champion of the previous year's competition, Mr. Fluffenstuff. I ask that she be judged on her own merits instead of the judges considering that she is the daughter of a champion and should have better "fluffy" genes than other dogs might have. The judges would try to ignore who her sire was and just judge how fluffy she is the same way they would judge any other dog in the competition. Then if she won, it would be because of her own merits and not because the judges knew she was the daughter of a champion.
Here's another example - let's say I'm frightened of octagonal things because when I was young a US stop sign fell and hit me on the head. A friend has painted a beautiful picture, but they painted it on an octagonal canvas. Now, that shape is hard for me to look at, so I could say I don't like that painting. Or, I could judge the painting on its own merits and not by the shape of its canvas and maybe have a different opinion.
On the other hand, from some contexts I read on the Internet, I understand that it means that "the same wrongdoing may not be offense in other cases"
That's not exactly the right way to look at it. A "case" is not a "wrongdoing". A case is trying to determine if a wrongdoing has happened, and if so, what the punishment should be. Two cases can be judging the same "wrongdoing", but there will be differences. Maybe the witnesses in one case are more reliable than in the other case, or maybe there is evidence in one case that doesn't exist in the other. Each case should be considered independently and be judged based on the evidence presented in that case. They shouldn't be judged by what people think based on what they've read in the newspaper, or what their neighbor told them, or anything else.