You can't create a new background process which each iteration. You will run out of resources. When you run it in the foreground, you wait for it to finish then create a new process. You can use the wait command to wait for the background process, but what is the point of that?
The while loop can make 300000 in 30 seconds. That's 300000 separate processes all running AT THE SAME TIME. Your system cannot have that many processes going at the same time.
When you run it in fg, it creates one process at a time. One process vs. 300000.