Better Solution:
I would recommend that each requirement be manually labelled, and ensure that duplicates are not used. The MWE below produces:

but if you had accidentally used the same environment label (ie, if the last one was used as \begin{Requirement}{1}, this produces:
Package Requirement Error: Duplicate Requirement: 1.
so the author would be made aware that a different requirement label needed to be used.
This version is based on Ulrike Fischer's suggestion:
Code:
\documentclass{article}
\usepackage{xstring}
\newcommand\CheckForDuplicateRequirement[1]{%
\ifcsname Requirement#1\endcsname %
\PackageError{Requirement}{Duplicate Requirement: #1}{}%
\else%
\expandafter\gdef\csname Requirement#1\endcsname{}%
\fi%
}
\newenvironment{Requirement}[1]{%
\CheckForDuplicateRequirement{#1}%
\textbf{Requirement #1:}%
}{%
}%
\begin{document}
\begin{Requirement}{1}
This is the first requirement
\end{Requirement}
\begin{Requirement}{X}
This is the second requirement
\end{Requirement}
\begin{Requirement}{Z}
This is the third requirement
\end{Requirement}
\end{document}
Old Solution:
This solution builds a list of the references using How keep a running list of strings and then process them one at a time, and issues a \PackageError if a duplicate requirement label is provided
Notes:
- With this approach, the labels can be numbers and/or letters but should not contain
<, or > as I use that as a delimiter for the strings. This is to ensure that test works properly for labels that are sub-strings of other labels. Previous version would have reported a duplicate if the label was XX was used followed by X.
Code:
\documentclass{article}
\usepackage{xstring}
\newcommand\RequirementList{}
\newcommand\CheckForDuplicateRequirement[1]{%
\StrPosition{\RequirementList}{<#1>}[\Position]
\IfEq{\Position}{0}{%
\global\edef\RequirementList{\RequirementList<#1>}%
}{%
\PackageError{Requirement}{Duplicate Requirement: #1}{}%
}%
}
\newenvironment{Requirement}[1]{%
\CheckForDuplicateRequirement{#1}%
\textbf{Requirement #1:}%
}{%
}%
\begin{document}
\begin{Requirement}{1}
This is the first requirement
\end{Requirement}
\begin{Requirement}{X}
This is the second requirement
\end{Requirement}
\begin{Requirement}{Z}
This is the third requirement
\end{Requirement}
\end{document}