The answer to this question is very well described in chapter 5. The easy answer is that Silas was out getting thread and materials for his work. The reason why he did not lock the door is because he was using his lock-string to hang the pork that was given to him by Miss Priscilla Lammeter, so it would cook.
A more in-depth answer is the following:
Silas Marner would enjoy the night time for many reasons. He would touch his gold and silver pieces, eat his supper (his favorite meal), and take strolls. He also did the comings and goings of his work during this time, while spending all day at the loom.
The reason why this is important is because it shows that Silas was again falling into a predictable routine that always renders him way too complaisant. This amount of comfort is always dangerous. It can lead to overconfidence and to taking life, people, and even something as extremely fickle as time, all for granted. Nothing in life is granted. Absolutely nothing. That is the entire premise behind the ultimate reason why Silas failed to lock the door of his cottage.
his mind was at ease, free from the presentiment of change. The sense of security more frequently springs from habit than from conviction[...]. The lapse of time during which a given event has not happened, is, in this logic of habit, constantly alleged as a reason why the event should never happen, even when the lapse of time is precisely the added condition which makes the event imminent.
Not only was he getting used to the idea of life being the same over and over, but he was already manufacturing axioms and dicta regarding time, consequences, and people in general. Most of his manifestos on life were pretty ridiculous, but who is to blame a man who has not socialized for most of his life and leads the loneliest life in an entire town?
This influence of habit was necessarily strong in a man whose life was so monotonous as Marner's—who saw no new people and heard of no new events to keep alive in him the idea of the unexpected and the changeful; and it explains simply enough, why his mind could be at ease, though he had left his house and his treasure more defenseless than usual.
Therefore, the combination of habit, stubborn thinking, bad logic, and even greed all combined to create the scenario that would enable Dustan Cass to enter the cottage and steal Silas's gold.