I found out what was causing this problem. I had a plugin installed called Simple Posts Generator which I used to generate 10 sample posts for testing purposes. Since I generated the articles all at the same time, the post_date value in the database was the same for each post, which confused WordPress as to what post should come first.
I fixed it by going into the database and manually changing the post_date values so they are all different, which solved the problem. Now all my posts are sorted correctly in chronological order.