Alignment of mindless creaturesUncontrolled mindless creatures - Mindless creatures operating outside the control of a sentient creature have no alignment, and are treated as True Neutral objects for the purpose of alignment effects, unless they possess an alignment subtype.
Such creatures operate solely based on their programming, which may favor particular actions based on the animating force or effect, but which confers no alignment on the creature.
E.g. A golem animated by an earth elemental would, in the absence of any commands or stimuli to the contrary, remain motionless, or aimlessly stack materials. A zombie animated by an [Evil] spell that lost its master, in the absence of a contradicting command, would act to kill . Both have no alignments, though the zombie may still have the aura of its animating spell.Controlled mindless creatures - A mindless creature under the direct control of a sentient creature assumes the alignment of the controller for the purpose of all game mechanics. This control can be achieved by programming(golems made to obey specific masters for example), by magic(Command Undead or Control Ooze) or any other means(Undead obtained by Rebuking). Creatures with multiple masters of differing alignments only count the master which last successfully(failing to do so, e.g. losing a contested charisma check, does not count) issued a command.
Items and Alignment - Mindless items wielded by a sentient creature, or by a mindless creature under the direct control of a sentient creature assumes the alignment qualities of the sentient creature. Items with an intrinsic alignment restriction ignores the alignment of unqualified wielders, and creatures using Use Magic Device to meet alignment restrictions. Items containing aligned effects(e.g Holy/Unholy weapons) are treated as if they possessed the corresponding alignment subtypes.
Inspired by the discussion below--------------------------------------------------------------------
Should a Golem be effected by a Holy Word when he's skullfucking orphans? What about when he's pulling orphans out of a flaming building and someone casts Blasphemy? If a mindless creature does nothing but follow orders, then he's objectively Neutral. It doesn't matter what his actions actually are.
Every other mindless creature is Neutral aligned, unless you slap a template like Fiendish on it. What makes undead different?
You know, an interesting idea I just had, to have automatons and mindless minions be TREATED as having the alignment of their current master or neutral. After all, they are essentially a tool in every respect.