You would need to be monitoring the memory and swap usage as the swap file was created to have a chance to understand why the swap was created. Based on what you describe in text and in the screen shot, I see nothing that is concerning.
As to why swap was created when you assume you had free RAM. The OS can move to swap based on predictive measures. For example, maybe you started up Photoshop which had several large image files automatically reopen from a prior session. The OS could see that there was suddenly a huge new demand on RAM, and moved some unused RAM content to swap in advanced of an expected need.
Or your backup program briefly ran in the background, and did a huge number of file checksums and comparisons and created large RAM based data structures, pushing other content to swap. Then the backup program released its RAM and went back to sleep.
Mac OS X (and most modern OS: Windows, Linux, etc) are very intelligent about automatically using Cache, Swap, memory compression and other techniques to keep the system running as fast as possible. I really would not be worrying about this unless you see that the Activity Monitor is reporting that Memory Pressure is in the Yellow or Red zone.
I currently have a 2010 13" MacBook Pro that has 16GB of RAM. I do lots of work that is heavy on RAM usages. (Web Development, data mining, running many heavy duty apps at the same time.) Even with 16GB I sometimes hit the Yellow zone for memory pressure. But I have to say this is seldom an issue because Mac OS X is very good about allocating resources as needed.
While I need the 16GB of RAM for my work, you should know that such an upgrade is not without negatives. The extra RAM does significantly reduce battery life both in active usage and in sleep.