I've been trying to find an answer, and to be honest, I'm unsure about the answer I gave..may allah forgive me for having said something wrong :/. I don't know if you can or you can't...it seems as if you're not bothering the worshippers then you should be able to..but idle talk and things like that are disliked which is why I assumed studying worldly matters would be too. Wa allahu a'lem. I personally cannot give you a straight answer.
A masjid is a place of gathering, not just for the purpose of religious activity, but for social matters as well as matters of education, contemplation, planning and more.
We, as an Ummah need to recognise that Allah has given us masjids for not only our spiritual well being but also our more physical reality - and the issues pertaining to these.
For example, a Muslim wants to know if the scientific method employed by the west is actually practiced honestly? His interest being Science, and the his loyalty being Islam. In the modern age, they'd seem to be in direct conflict.
But the imam can educate the seeker in understanding that a Muslim academic named Ibn Hatyhm perfected Ptolemy's model and removed the shirk from it to form the scientific method we have today, which, when practiced in truth will bring one closer to Allah and increase ones imaan.
And then he can inform the seeker how, the scientific method practiced by atheist scientists is hugely flawed given the inductive fallacy they entertain.
Ie: the atheist scientist is not conerned with the WHY, but only the HOW...
...where else would the seeker go to have his understanding augmented like this? The crazy internet?
Scimi