Here's why; If you paid a security deposit and changed your mind about renting the apt, the LL would have to return your security deposit in full. The LL does not have to return the first month's rent becuase the LL took the apt off the market. The broker has fulfilled its obligation to find you an apt and therefore it is entitled to its fee as outlined in the agreement you signed with broker. This common in NJ. I always advise my LL to take the first month's rent rather than the security to hold an apartment. Many LL will request, the first's months rent and security at lease signing.
If you went through a broker, he or she is entitled to a fee which you agreed to by contract. This is separate and apart from any agreement or agreed-upon rental agreement (e.g. lease) you entered into with the landlord. I see nothing untoward about this arrangement.
The foregoing is not legal advice, and nothing in the foregoing shall be deemed to create an attorney client relationship. If you feel you need to speak with an attorney regarding your issue, it is recommended that you contact an attorney with expertise in your area of inquiry. The information related above is purely for informational purposes, and should not be acted upon without speaking with qualified counsel familiar with you specific situation and the laws related thereto.