It's because (AFAIK) you cannot put expression as an ID in the hash constructor, because they're automatically quoted as strings.
In other words, this is valid JavaScript
$(this).load(url, {name: "Foo", age: 13});
The keys name and age are there. In JavaScript you don't have to quote the keys of a hash, although in strict JSON the quoting is necessary for keys. (But the quoting wouldn't hurt. And in some cases, as Jordan suggested in the comments, it's necessary e.g. you want to use reserved words like var as the hash key)
To accomplish your desired effect, I would suggest a lengthy solution (any clever one-liner anyone?)
var varname = "class_id";
var data = {all_ids: allids};
data[varname] = openedid;
$(this).siblings('.container').load(loadurl, data);