The Noldor and Dwarves liked each other
Although you're right that Dwarves tend to be insular, by all accounts they got on quite well with the Noldor; according to The Silmarillion:
[T]he Naugrim gave their friendship more readily to the Noldor in after days than to any others of Elves and Men, because of their love and reverence for Aulë; and the gems of the Noldor they praised above all other wealth.
The Silmarillion Part 3 Quenta Silmarillion Chapter 10: "Of the Sindar"
You don't build a door to keep out your friends.
They were made in happier days
Gandalf says this explicitly (emphasis mine):
'Well, here we are at last!' said Gandalf. 'Here the Elven-way from Hollin ended. Holly was the token of the people of that land, and they planted it here to mark the end of their domain; for the West-door was made chiefly for their use in their traffic with the Lords of Moria. Those were happier days, when there was still close friendship at times between folk of different race, even between Dwarves and Elves.'
Fellowship of the Ring Book 2 Chapter 4: "A Journey in the Dark"
They were also evidently not often closed, as Gandalf mentions later:
These doors have no key. In the days of Durin they were not secret. They usually stood open and doorwards1 sat here. But if they were shut, any who knew the opening word could speak it and pass in.
Fellowship of the Ring Book 2 Chapter 4: "A Journey in the Dark"
It's important here to note what Gandalf means by "happier days"; a common assumption in some of the other answers is that Moria needed to be protected from the servants of Sauron, but this just isn't true.
According to Appendix B: "The Tale of Years", Eregion was founded in S.A. (Second Age) 750, so presumably the West-gate was built around this time as well. Although Sauron was active in Middle-Earth at this time (Appendix B tells us that he arose c. S.A. 500), he was largely keeping to himself; his master Morgoth had only recently been defeated, so Sauron was keeping a low profile.
Things weren't really that dangerous in Middle-Earth at this point in the Second Age; Morgoth had been destroyed, and Sauron wouldn't actually assume the mantle of Dark Lord until the forging of the One Ring in S.A. 1600. Even then, it's notable that the West-gate isn't sealed until S.A. 1697, shortly after Sauron destroys Eregion. Clearly the Dwarves were relying on the Elves of Hollin to keep the Orcs at bay, which they seemed to do quite a good job of.
Not many people were knowledgeable enough to open it
There's no particular reason to believe that your average passer-by would be able to read the inscription; it was written in an archaic Elvish script, according to Frodo and Gandalf:
'What does the writing say?' asked Frodo, who was trying to decipher the inscription on the arch. 'I thought I knew the elf-letters but I cannot read these.'
'The words are in the elven-tongue of the West of Middle-earth in the Elder Days,' answered Gandalf.
Fellowship of the Ring Book 2 Chapter 4: "A Journey in the Dark"
As commenters have noted, the inscription is written in a version of the Tengwar script that seems to have been used exclusively by the Noldor, one of several tribes of Elves living in Middle Earth at the time2. The script would have been unfamiliar to any passing Sindar or Silvan elves.
It's rare enough for your average Man to have a working knowledge of Sindarin, so for a door that was meant to be used by Dwarves of Moria and Elves of Hollin, this is enough security.
1 Considering the context, this word is likely meant to mean "door guardians" rather than "towards the door". The issue of guardians is dealt with by Valorum
2 For a detailed discussion on the different Elvish tribes, see Is there more than 1 species of elf in the Hobbit/LOTR saga?