Don't take it as a general rule ('acid needed for tests for ions'); however, in the two specific cases you cite, the explanation is that at higher pH you can have side reactions which interfere with your test.
I give you a hint: forget about the anion you're analysing and think of what you have in solution in your reagent. In one case is NO3- and Ag+, in the other Ba2+ and Cl-.
Now, what can happen to these species if you make the pH rise (adding OH- ions)?
You should also consider that your solutions are in contact with air.