I'm sorry you had this bad experience.
I agree with hvert that you might not find out the reasons why this assignment ended.
A few years ago I had some 'temp to hire' jobs too and unfortunately...a lot of companies just want to avoid paying benefits so they keep a certain number of temps around. I don't think this is right but it is reality.
It seems like you are having a hard time to let go of the mistakes that you made in the 2nd of 3rd week of the assignment. I have the same problem with making mistakes; it is not easy to accept that anywhere humans work mistakes are made...and try to move on. Try to see it as a learning experience though; hopefully future assignments will work out better for you!