Consider the Romulan's position. There was a new region of space suddenly accessible, with none of the history or diplomatic complexity of the Alpha Quadrant. They need information, or else they risk falling further behind in power in the Alpha Quadrant. The problem for them is that their relations with the Federation (and by extension Bajor) make it very troublesome for them to access the Gamma Quadrant. According to Memory Alpha, no Romulan ships entered the Gamma Quadrant until the Tal'Shiar attack on the Founder's homeworld.
Since the Romulans didn't have free access to the wormhole (their cloaked vessels still cause the wormhole to visibly open, and they didn't have free access to Federation or Bajoran space), they used the Defiant to do the job for them. They made a very specific alteration to the treaty banning Federation use of cloaking devices, so that one could be installed on the Defiant.
Originally, the cloak was monitored by a Romulan officer named T'Rul. She had the opportunity to explore one of the Federation's most advanced warship prototypes from within, which may have factored into the Empire's decision process. It was also limited in use to the Gamma Quadrant. Later these restrictions were either lifted or ignored. Eventually the Empire and the Federation entered an alliance, meaning their strained relationship would be less of a concern, though no further ships were equipped with cloaking devices during DS9.
The first episode with the cloaking device also reveals the Romulans are aware of some limitations of their cloaking devices, which they may (this is conjecture) conceivably use to prevent the Defiant from becoming a direct threat to them if war ever breaks out.
It has also been shown that the Federation is technologically capable of making a cloaking device of their own, and have instances of Klingon devices they could reverse-engineer. There is also the possibility that they could simply buy or request the devices from the Klingon's during their alliance. The Federation only avoids cloaking technology on diplomatic grounds, not technological, or economical.
Even with a cold war, or at least cold relations, the Romulans had a lot to gain from giving a single Federation ship a cloaking device. They risked very little in providing a single device and license to use it.