Cards on the table... I'm a police officer.
I don't know whether you're innocent or not and I'm not going to pass specific comment.
On-going neighbour disputes are extremely difficult. They get referred to the police because none of the other Emergency Services would deal with them - they don't involve rescuing/saving people so they must be a police problem, and councils don�t work 24hrs.
Assuming innocence...
It sounds like your neighbour complained and somebody came round to speak to everyone.
Imagine the call to the Control Room - "my neighbour's flashing at me". It would have to get a response.
The officers/community officers have probably spoken to your neighbour and come round to warn you that the person next door can see you and it caused them offence.
It means that the neighbour is told that you've been spoken to, and it means that you've been made aware that they were unhappy.
Unfortunately common sense rarely applies anymore. The laws are getting more and more ridiculous as the government desperately tries to rectify mistakes made previously.... ASBOs for example are a reaction to public outcry at the courts not doing anything about disorder, yet if the government hadn't weakened sentencing powers of magistrates and judges and hadn't run away in fear from the Human Rights Act, ASBOs wouldn't have been needed.
Because everyone's scared of complaints (Senior Management would rather reprimand their own staff even if they've done the right thing, rather than risk a complaint themselves) action is taken more and more regularly in order to cover oneself. Not always right, and certainly not what most police officers want.