Somebody put them there so they can travel quickly between planets, but how did they travel to the planet far away without a Stargate to build one there?
Stargate Universe takes place on the starship Destiny, a huge ship of The Ancients whose purpose is to explore the universe without Stargates. The Destiny is capable of FTL and uses stellar plasma as fuel. Destiny was preceded by Seed Ships which would scout ahead and manufacture and plant Stargates.
Whether this is how the rest of the Stargates were seeded, via automated starship, is unknown. But it was likely using FTL drive to initially reach a planet and building a Stargate upon arrival.
The Ancients placed all of the gates in both the Pegasus as well as milky way galaxies. They also had the ability to travel faster than light in large ships that could carry multiple star gates at a time to drop them off on planets that could potentially have life. The Ancient's home galaxy was the galaxy the Ori remained in, and they most likely had already created the gate network in that galaxy before heading to the milky way.
Obviously, the builders of the stargates had starships that let them travel to all those planets and install the gates. The same way the Goauld have starships. You see one Goauld ship in the movie, and you see a lot of their ships in the series.
The Ancients seeded planets with stargates using superluminal ships. One of these ships is the setting for the series Stargate: Universe.
One thing you need to remember is that even before the Destiny the Ancients (shown in Stargate Ark of Truth) used a giant spaceship to evade the Ori armies and flee to the Milky Way galaxy.
The had the capacity to seed worlds and merely (as mentioned in season 1 of SG-1) used the Stargate for convenience, not as a requirement for travel.
So the real question is not how without ships but which ship, the Destiny or some other ship; as others have stated this has never been made clear.
In contrary to @Himarm's answer: it is hard to say if the Ancients created the gates in the Ori galaxy. Hints in SG-1 (Ancient story book) and Ark of Truth suggest that it was still in the idea phase when the ancients left, but that is also not clear.
We see in The Ark of Truth that the Ancients had large starships at the time that Amelius had the idea that would become the Stargates. Therefore it's entirely reasonable to suppose that the Stargates made it to their planets via starship.
Furthermore (although this proves nothing about the Milky Way, Pegasus, Ida, or Ori-galaxy networks) we see evidence of this in SGU in the form of the seed ships, whose purpose included constructing and delivering gates to planets.