I don't disagree, what I hear when I read this comment are the same points I brought up but phrased a bit differently.

As a huge disclaimer, the charges may simplify to "we told you you couldn't go, and you went, so we get to put you in prison." And if that were true then the only question that would be answered here is whether or not the government has the right to lock you up for attending a conference without their permission. The complaint reads like their going for a more "material assistance to the enemy" kind of theory but I don't know and I'm not a lawyer.

That said, hopefully you don't mind me using your two statements as the foundation for questions they bring up.

"This isn’t about the legality of math.
It’s about what you are doing, or helping others do."

I agree with that statement and I recognize that things I sometimes think should be true, turn out not to be as clear cut as I would like.

So lets say his paper was "Comparing different proof-of-work algorithms for the foundation of a crypto-currency."

That would be pretty much pure math. Algorithms where you couldn't "cheat" and get to the answer sooner than anyone else running the same algorithm. So should 'doing' that, or helping someone else 'do' that rise to the level of illegality? If so case law helps define tests for when something should be considered "bad" and when it is "ok." Let's step to your next point.

"Goals and intended outcomes matter. Knives aren’t
generally illegal, we all have them in our houses,
but stabbing someone with one generally is."

There is the "thing" and there is the "intent" to use the thing to do something bad. There are three "persons" in the above statement, the person that made the knife, the person that owned the knife, and the person that used the knife to do harm to another person or property. And yes, they could all be the same person) but which of those three persons are the criminal? In the USA we tend to lean toward the third example, the person using the tool to do harm. After all, you can do property damage with a baseball bat, and it isn't the bat makers fault right?

So if you talk about blockchain to someone does that make you a criminal? Or are they a criminal when they try to use it to do some illegal act? Now if you knew that was what they were going to do, again in the USA, you could be charged with conspiracy. But if you didn't know, you were just talking in a hypothetical way like "I bet that bat would totally smash those 'unbreakable' windows on that cybertruck." Are you conspiring really?

"Calculating equations isn’t itself illegal,
but for example calculating the ballistic profile of a
missile aimed at a city and passing those results to an
enemy state might be a crime."

The challenge here is that in the US there is a presumption of innocence. So calculating a ballistic missile profile of a missile that launches from some place and then impacts some place else, is something you can easily do in the Kerbal Space Program. As far as I can tell its pretty dang accurate. So if someone shares with the news network the game files to show where a purported ballistic missile could hit if fired from the DPRK, are they doing something illegal? Even if knowing how Kerbal works, you could play with that file to figure out what parameters your rocket would have to meet if you wanted to hit a specific target?

"Similarly teaching their people to calculate such profiles, knowing what they intend to use that information for, could reasonably be criminal."

Agreed, it is all in the "knowing" part. It is clearly conspiracy if someone asks you to tell them how much peanut is needed to kill someone with a peanut allergy because their enemy is allergic to peanuts and it seems like a good way to get rid of them. But if they just ask out of the blue with no context and you answer, are you conspiring?

The original question was "What could possibly be his motivation for doing this?"

It is an important question because motivation is required for there to be a crime. Understanding and proving that motivation is going to be key to getting a conviction. From the coverage so far it does not seem like it was money (I haven't read anywhere that the guy was paid some outrageous speakers fee or anything.) I also haven't seen anything to suggest it was a treasonous thing.

I struggle to think like a criminal mastermind, so I rely on thinking like an engineer; knowing that in politics, relational, and legal questions my thinking will be flawed :-).

So the interesting questions here for me are the ones that define what is, and what isn't, a criminal act with respect to algorithms.