You want to qualify to work in the United States. That means you want to immigrate into the United States, and want to take this test to further your goal of immigration. In order to get a B1/B2 visa, you must not have the intention of immigrating into the United States. Thus your visa was denied.

