The command \catcode32=9\relax
(or \catcode`\ =9\relax
) will make TeX ignore all spaces in the current group/environment. You could define your own environment and add it and {grammar}
to it.
\documentclass[leqno,fleqn,12pt]{report}
\usepackage{bnf}
\newenvironment{Grammar}{%
\catcode32=9\relax
\begin{grammar}%
}{%
\end{grammar}
}
\begin{document}
% Either
\begin{grammar}
[(colon){$\rightarrow$}]
[(semicolon)$|$]
[(comma){}]
[(period){\\}]
[(quote){\begin{bf}}{\end{bf}}]
[(nonterminal){$\langle$}{$\rangle$}]
\catcode32=9\relax
<rule-working>:<formats>,<correctly>;<without>,<whitespace>.
<rule-not-working> : <formats> , <incorrectly> ; <with> , <whitespace> .
\end{grammar}
% or
\begin{Grammar}
[(colon){$\rightarrow$}]
[(semicolon)$|$]
[(comma){}]
[(period){\\}]
[(quote){\begin{bf}}{\end{bf}}]
[(nonterminal){$\langle$}{$\rangle$}]
<rule-working>:<formats>,<correctly>;<without>,<whitespace>.
<rule-not-working> : <formats> , <incorrectly> ; <with> , <whitespace> .
\end{Grammar}
\end{document}

As Joseph Wright pointed out there are more space-like characters you might also want to ignore:
\catcode9=9\relax % Horizontal Tab
\endlinechar=-1\relax % No line endings
A space or non-expandable TeX command like \relax
must follow the number so TeX knows to stop reading digits.
and maybe these (just to be on the save side):
\catcode10=9 % New line
\catcode11=9 % Vertical Tab
\catcode12=9 % Form Feed
\catcode13=9 % Carriage Return