How important is it to roast nuts in a single layer? In every recipe I see for roasting peanuts/walnuts they tell you to put only a single layer of nuts on the plate that goes in the oven. How important this instruction really is?

If you have a large amount of nuts it's much more efficient to pile them all up on the plate and be done with it.
If you pile them up, the nuts on the outside will burn before the nuts in the middle are properly roast. It's as simple as that.

As with most things, spreading nuts out in a single layer before roasting means that they will all roast at the same rate and brown evenly.