The root category is set at the store level. So all store views in a store have the same root category. To set that manually, just edit the store in System->Manage Stores and select it from the Root Category dropdown.
note: the category must be a top level one.
To set it by code do this:
$websiteId = '1';//change it if it's different
Mage::getModel('core/website')->load($websiteId);
$stores = $website->getGroupCollection();
$rootCategory = 12;//change the id of the category here
foreach ($stores as $store){
$store->setRootCategoryId($rootCategory);
$store->save();
}
There is no 'out of the box' way of making sure that any other store added to the website will have the same root category since the possibility of having different root categories for different stores is a feature of Magento. Maybe you can add an observer on the store_group_save_after event and setting. Something like this:
public function observeStoreGroup($observer){
$group = $observer->getEvent()->getStoreGroup();
if ($group->isObjectNew()){ //check if the store is being created.
$group->->setRootCategoryId($rootCategory);//use the same $rootCategory as above
}
}