I want to loop over an array of product IDs in Magento. In the loop I am displaying some custom attributes of the products as:
foreach ($products as $product
you use Singleton when you want only one instance of an object in whole application. So when you use getSingleton it always returns the same object that can have some data loaded earlier.
So in this case when the loop starts it create new object (of course only if this was not done before in some other place in magento) and loads the data for $product['id']. In next loop iteration it takes the same object with previous product id data and loads to it new $product['id'] data. This is why there can be some problems.
If you want to have two different products you must use getModel.