At the end of The Avengers Thor takes the cube to Asgard, and at the end of Thor: The Dark World Volstagg implied that they have the Tesseract in Odin's Vault. So why they didn't use it against the attacks from the Dark Elves?
The Tesseract, now revealed to be one of the Infinity Gems (or Stones as the MCU has renamed them) is far too dangerous an artifact to be used as a weapon.
Much like the Nuclear weaponry of the Cold War, the very possession of such power bears a responsibility that they should never be deployed: and require a guardian who understands the cost of their use.
Odin, it could be said, is the jailer of the Stone, rather than it's owner. It is not only for the preservation of 'honour' or some sense of sober responsibility that Odin would keep the weapon hidden, but in lieu of his greater understanding of the threats of using such power in the wider Marvel Cosmic Universe: which audiences are being primed for by the introduction of this Summers Guardians of the Galaxy.
The Infinity Gems/Stones are basically (when combined with the Infinity Gauntlet that was sneaked into Thor) the cheat codes to reality, and possibly the most powerful weapon in existence.
Odin is already guarding the infinity gauntlet and one of the infinity stones, but considers keeping two of them together such a risk that would rather relinquish control of it to The Collector rather than keep two in proximity. He is clearly aware of the risk, and potential danger of keeping half the components of the Ultimate Weapon together, but it's still an extreme step to hand over one of the keys to a nuke to someone outside his control :although the Collector is clearly considered an ally (and somewhat respected) by Asgard from the deferential obsequiousness Sif and Volstag adopt in his presence.
Of course, Sif and Volstag could be acting under the misinformation of Loki posing as Odin, but we can't infer anything until we know more.
As alexwlchan pointed out in the comments above, however, the 'tie-in' comic Thor: TDW Prelude disagrees with the reluctant burden of the Tesseract, however:
It is worth pointing out, however, that the Comic is published by Marvel Comics, which is not owned by/made in direction syndication of Marvel Studios: Yes, they are both owned by Marvel Entertainment, and yes the transmedia story is being explored within the same universe iteration (Earth-199999), but just because stories are serving the same interests doesn't mean they are automatically free of inconsistencies.
Comics will share information with Studios (and Vice-Versa), but that doesn't mean they have the same level of knowledge about unfolding events, nor does it deny them the right to use their creative freedom in telling their own stories outside of the direct Authorship as the Studios writers. As the Comics are only supporting merchandise for the Movies, the plot details of the Movies will automatically take precedence for canon.
This might not neccesarily be an inconsistency:
There is a recurring motif within the MCU, perhaps best posited in Iron Man 3:
"Question: When is a weapon not a weapon?"-Tony Stark
And the Answer?...When its a technology.
A theme that seems to be being quite heavily pushed is the discussion of the power of responsibility when it comes to modern Technology.
Maya Hansen believes Extremis is a technology that, when harnessed correctly is capable of doing great good for mankind. It is the only reason she is working with Killian.
Similarly, the Agents of S.H.I.E.L.D episode 'Seeds' makes these connotations more obvious when agents Fitz and Simmons deliver a lecture to SHIELD Academy students about the danger of technology in the wrong hands, drawing direct attention to the theme with a discussion of Nuclear Technology and Hiroshima.
Odin could be quite happy to use the Tesseract as a tool for good (in this case repairing the Bifrost), but its deployment as a weapon would be a totally different application of its powers, and one in which the Old God has the wisdom to understand the difference, and requirement of restraint.