First, this issue doesn't come up for people on active duty. 10 U.S. Code § 973 forbids active-duty military officers from holding or exercising the functions of an elective federal office; DoDD 1344.10 extends that to all active-duty personnel. Both the law and the directive also apply to reservists or retirees on long-term active duty (more than 270 days).
Second, for status reasons, this is much less likely to come up with enlisted personnel. The sort of people who serve in Congress are generally also the sort of people who'd be officers. Many of the relevant restrictions apply to people holding office in the executive branch, and enlisted personnel do not hold office (only commissioned and warrant officers do).
Third, an interesting quirk that makes this even more significant: Retired military personnel do not technically leave the military. They're no longer in active service, but they are still military personnel, bound by the UCMJ, and subject to both voluntary and involuntary recall. In fact, people retired from active-duty components are bound by the UCMJ at all times, whereas non-retired reservists are only bound by it when called up. If this is an issue for reservists because they might be called up, it's also an issue for retirees.
Now that we've handled preliminaries, the central issue comes from the Incompatibility Clause in Article I, Section 6 of the Constitution:
[N]o person holding any office under the United States, shall be a member of either House [of Congress] during his continuance in office.
The question is whether reservists count as holding an "office under the United States." If it does, you have to resign from the reserves before entering Congress. However, Congress decides whether or not someone is qualified to be a member, and Congress has generally refused to explicitly decide if reservists are allowed (implicitly meaning that yes, they are).
6 Cannon's Precedents §§ 60--62 covers the situation as of World War I: the House Judiciary Committee recommended that members of Congress who had accepted National Guard commissions be considered to have forfeit their seats in Congress, but the full House didn't act on the recommendation. After the war, the House decided to pay members who had been on military service the difference between their congressional pay and military pay. In the second debate, the House considered the difference between temporary and permanent office. It was pointed out that in past wars, members had served as officers in short-term volunteer units and then returned to their seats at the end of their service. It was also pointed out that an "office" is an inherently permanent thing: a temporary commission for the duration of a war might not necessarily be an office.
2 Deschler's Precedents § 14 discusses how things played out in World War II and beyond. Here, the US involvement was much longer, and there was more consideration given to the problems with holding both offices. The executive branch was the one that complained; they decided that serving in Congress was more important than serving overseas, and that military personnel who were also in Congress would be told to pick one (either go back to Congress and serve there, or resign from Congress and be in the military). In 1965, the Defense Department issued an order (currently found in DoDD 1200.7) which provides for the involuntary transfer of people in key positions (including all members of Congress) from the Ready Reserve to the Standby Reserve. Congress did not like that, and they (finally) struck back in the 2016 NDAA: they amended 10 U.S. Code § 10149 to ban transfers to the Standby Reserve based on service in Congress. This certainly seems to promote the idea that Congress thinks reserve service is allowable, but when Barry Goldwater tried to get a resolution to that effect in 1963, Congress didn't act on it.
So in summary: Congress (which enforces the Incompatibility Clause) hasn't explicitly said simultaneous reserve service is allowable, but has essentially let it happen. The executive branch has tried to discourage it, but Congress has opposed that (personally, my guess is that members of Congress want the political benefit of saying "I'm currently in the military," while the military would prefer not to have them).
I've discussed how Congress handles it, and Congress does have the final authority to judge the qualifications of its members. There was one Supreme Court case (cited in Deschler's Precedents) where a group tried to get the two positions ruled incompatible, but it was dismissed on standing grounds (the group could not establish that they were particularly harmed by the alleged violation). A lower court had held that the offices were incompatible, but that ruling was vacated by the Supreme Court.
However, there was another opinion issued in 2006 where the courts couldn't duck the question. Sen. Lindsey Graham was also an Air Force lawyer (he's since retired), and while a Senator he was tapped to be a military judge on the Air Force Court of Criminal Appeals. An airman was convicted at court martial and appealed to a panel that included Graham, then appealed again to the Court of Appeals for the Armed Forces. There's no question that a criminal defendant has standing to challenge whether his judge can legally be a judge, and Congress does not have the final say over whether someone's qualified to be a military judge. In US v. Lane, the CAAF held that Graham's office in the Senate was incompatible with service as a military judge. However, the CAAF cannot tell Congress "you can't be an active reservist and a sitting member of Congress." Even the Supreme Court is limited in its ability to interfere with Congress's decisions on the qualifications of its members: the Court did hold that Congress can't add qualifications, but this is a question of "does this provision apply to this person," which Congress has final authority over.