Am I interpreting Article 2 of the UCMJ correctly, in that foreign POWs in our custody may be punished under those codes? What can they ‘do wrong’, and what are the punishments?
Yes
What can they do wrong
Same thing any soldier does
what are the punishments?
Whatever the CM directs within the limits of the UCMJ, and considering some of the punitive articles aren't applicable to prisoners.