It used to happen on my '01. Something with the latch. It was a quick fix by the dealer. There are a few threads here, one was pretty recent. I can't seem to find them right now.
EDIT: Found them. Search "hatch opens" there are quiet a few. Here's one
http://www.xoutpost.com/x5-e53-forum/...ht=hatch+opens