Background
According to this answer of Who enforces the insurrection rules in the 14th Amendment, section 3?, congress enforces Section 3 of the amendment just as it enforces all other sections of the Amendment.
However, Congress deeming any officeholder as outlined in that section as "having engaged in insurrection or rebellion against the same, or given aid or comfort to the enemies thereof" sounds like a Bill of Attainder, which is defined by Wikipedia below:
A bill of attainder (also known as an act of attainder or writ of attainder or bill of penalties) is an act of a legislature declaring a person, or a group of persons, guilty of some crime, and punishing them, often without a trial.
In effect, it would be the legislature stating that someone committed a crime (Insurrection, rebelling, or giving aid or comfort to enemies thereof), and then punishing them by revoking their right to hold office. While it may adhere to the U.S. constitution, it would seem to go against the idea of the legislature deeming someone guilty and rendering punishment without a Judicial trial. This cutting against the grain of the "spirit of the law" led me to ask:
Question
How is congress' enforcement of Section 3 of the 14th amendment not a Bill of Attainder?