Deeper theological considerations aside, I think the first program might be the WHILE loop, as demonstrated in the clepsydra, an ancient water clock. While the weight of a cup being filled by a regulated flow of water is less than an opposing weight, the cup fills. When it exceeds the test, it causes the balance arm to move, advancing the clock and emptying the cup. Clocks are wonderful examples of machine logic, and clockwork mechanisms are great fun to study in terms of programming.