They had volunteered to be part of Operation Aphrodite, an unconventional attempt to destroy German targets in the summer of 1944, especially rocket launching sites. The project ultimately proved to be exceedingly dangerous for its pilots, and ineffective at damaging its intended targets. C'est la guerre.
According to the Joesph P. Kennedy Jr. Foundation: "Joe, regarded as an experienced Patrol Plane Commander, and a fellow-officer, an expert in radio control projects, was to take a 'drone' Liberator bomber loaded with 21,170 pounds of high explosives into the air and to stay with it until two 'mother' planes had achieved complete radio control over the 'drone.' They were then to bail out over England; the 'drone,' under the control of the 'mother' planes, was to proceed on the mission which was to culminate in a crash-dive on the target, a V-2 rocket launching site in Normandy.
"The airplane ... was in flight with routine checking of the radio controls proceeding satisfactorily, when at 6:20 p.m. on August 12, 1944, two explosions blasted the 'drone' resulting in the death of its two pilots. No final conclusions as to the cause of the explosions has ever been reached.
"Joe was posthumously awarded the Navy Cross ... and also the Air Medal ... In 1946 a destroyer, the USS Joseph P. Kennedy, Jr., destroyer No. 850, was launched at the Fore River shipyards..."
Interestingly, flying nearby at the time of the accident was Elliot Roosevelt, son of FDR. He was in a de Havilland Mosquito to film the mission, and while the explosion damaged his plane, he and his crew were able to return to base.