But we've never seen Starfleet act as regular law enforcement, and, indeed, DS9's "Homefront"/"Paradise Lost" makes it clear that the idea of Starfleet serving in such a capacity is the sort of thing that only happens when there's been a declaration of martial law.
Actually, Starfleet seemed to serve as the equivalent of the British Local Defence Volunteers / Home Guard in those episodes. The explicit threat was one of a surprise Jem'Hadar invasion while Earth's high-tech defenses were down, so there was a sudden need for rough-and-tumble infantry on the surface. The forces were not deployed for police action - say, hunting down of the saboteurs. Their stated job was to stop an invasion. (Their unvoiced job of course was to facilitate a military coup, but that's a bit beside the point.)
As for regular law enforcement, that's something one would rarely see in a future where crime has been drastically curtailed. The big crooks are all out there on the final frontier where there is less control, where Starfleet in fact is the natural choice for control no matter what. But it is still noteworthy that not a single arrest has been credited to a separate police force of a Federation member world, nor have we seen such officials in action or even in readiness. "National" and "Federal" intelligence agencies, yes (the V'Shar and Federation Security, respectively), but not regular police. Now, do we explain this by saying that there's so little crime we never need see the police - or by saying that the arrests we do see are good enough to set a pattern, pegging Starfleet as the beat cops of the time?
I'm hesistant to use real world precedent for settling this issue, because such precedent doesn't help with most Trek matters... Rather, I'm interested in accepting the six impossible things before breakfast that the show seems to present to me, exactly because that is interesting. But certainly there is room there to postulate a more conventional police setup, and generally to assume conventional solutions where there isn't explicit mention of unconventional ones.
Timo Saloniemi