The position of U.S. Attorney General was established in 1789, while the U.S. Department of Justice was established in 1870, nearly a century later.
For awhile after the ratification of the Constitution, the role of the Attorney General was to advise the executive and legislative branches (equally) on legal matters, not be the person in charge of the law's execution. Calls for reform of the AG position began shortly after the new system of government was established; the political climate in the Grant presidency aligned in just the right way to finally cement those desired changes.
In other words, it was not the original intention of the position for the AG to serve as a 'secretary' in the same sense as Secretary of State, Secretary of the Treasury, etc.