There are two angles here that need to be closely examined:
necessary — Were the atomic bombs necessary to end the war? This has been a subject of debate since 1945. The issue has been commonly framed (since 1947 in particular) as a question of "drop the bomb, or invade" — this is a rhetorical framing that is meant to convince people (esp. Americans) that the bombs were necessary, and should be taken with a grain of salt. If you fall into that trap it is hard to get out, because it is easy to imagine huge casualties for a land invasion of Japan (indeed, higher casualty figures than, say, Truman was ever told), and it also seems to make it seem like that was the issue being discussed at the time. It was not. It was never framed as bomb vs. invade — the idea was bomb and invade, and the real questions were about whether there were ways to use diplomacy as a tool to avoid invasion, what kinds of targets the bombs should be used, the role of the Soviet Union, whether the bomb should be "demonstrated" before used on a city, etc. I've written a bit on the "alternatives" that were discussed at the time here — the point I am trying to make is not that any one of those might be preferable to what was done ("drop two atomic bombs on two cities, prior to the anticipated Soviet declaration of war on Japan, within the span of 3 days"), but just to point out that the "bomb vs. invade" dichotomy is a false one, and a deliberate "trap" created by US officials (notably Stimson, Groves, and later Truman) to justify their actions when they came under scrutiny and criticism.
evil — Were the atomic bombs an "evil" act? This will depend very largely on what you view the legitimate conduct of war. Is it an evil thing to deliberate incinerate civilians by the hundreds of thousands? Is it acceptable under a doctrine of "ends justify the means"? What about a doctrine of "just war"? Who decides which cause is "just"? What obligation is there to try other options (e.g., a conditional rather than unconditional surrender)? These are questions without objective, definite answers, but that does not detract from their importance. The way I like to pose the moral question is: "Under what conditions is it acceptable for a state to deliberately set hundreds of thousands of civilians on fire?" The answer need not be "no conditions" — one might say, "if the only alternative is worse, if the cause is a just one, if all other options have been exhausted," etc., but the very asking of the question this way focuses our attention on the key moral/ethical conundrum posed not only by the atomic bombs but on the targeting of civilians during World War II (which was done by all sides, but that does not necessarily "legitimize" it from a moral perspective). Without wanting to create a too exact equivalence between atomic and firebombing, it is worth remembering that by August 1945 the US had already been setting Japanese on fire en masse using napalm for months, with the result being that nearly every city of importance had been destroyed prior to Hiroshima and Nagasaki. (Hiroshima was in fact "reserved" from firebombing so that it could be an atomic bomb target; Nagasaki was not, which is an interesting aside.)
So the answer is, "necessary evil" is a tricky term — that doesn't mean it shouldn't be contemplated, but you should be aware that it opens up a very big (but important) can of worms. Any answer that is short and glib is unlikely to be adequate.