1) How are you stretching your hamstrings? i.e. what moves are you using?
2) Does the stiffness show up the day after the stretching?
I had a period where I had lower back stiffness on waking. After a while I realized it was due to the stretching exercises I was doing (like you, designed to stretch my hamstrings). After I stopped stretching that way, the stiffness went away completely.