Ministers in London recently fast-tracked through legislation to ensure police and security services can access mobile and internet data.
The Data Retention and Investigatory Powers Act received Royal Assent on July 17, exactly one week after Prime Minister David Cameron and his deputy Nick Clegg had announced their intentions.
Mr MacAskill told MSPs at Holyrood that the legislation would “extend to Scotland and have implications for justice in Scotland”.
The Scottish Parliament was on its summer break when the legislation was passed by Westminster, with the Justice Secretary making a statement on it to MSPs on their first day back.
“There was always going to be a significant level of interest in Scotland in these matters,” he said.
“It is regrettable, to say the least, the Scottish Government was not given the opportunity it should have been afforded to properly consider and express views on this very significant piece of legislation.
“In May 2010, the Prime Minister David Cameron announced that he wanted an agenda of respect ‘about parliaments working together, governing with respect’.
“The levels of respect appears not to have been afforded to the Scottish Government on this occasion.”
He said he only found out about the legislation on July 10, the same day that Mr Cameron and Mr Clegg made a joint announcement about it.
Mr MacAskill said he received a copy of the draft Bill by email that day, and had a “hastily arranged telephone conversation” with UK Government Security Minister James Brokenshire.
“This ignores the proper processes expected from a Westminster Government when passing legislation which extends to Scotland,” the Justice Secretary said.
He stressed the need for joint working between authorities when tackling issues such as organised crime and terrorism, saying: “It is in every government’s interest that we combat crime and address security risks. Sophisticated terrorists and criminals seek to exploit an ever changing and rapidly developing telecommunications market, so too must our law enforcement and security and intelligence agencies have the tools they require to keep pace and keep us safe.
“They need to be able to track down the drug dealers, would be terrorists, pursue human traffickers, deal with child exploitation and find missing persons.
“Serious terrorists and criminals have no respect for borders, the response from law enforcement, security and intelligence agencies and other partners requires a joined up approach to those threats.
“We are all on the same side, but this situation cannot be used to explain away the need for proper scrutiny of powerful legislative changes.”
He added: “There was ample time for views to have been exchanged and the sufficient opportunity for the respect that David Cameron spoke about in 2010 to have been paid.”
Tory MSP Margaret Mitchell said: “In an ideal world all legislation and ministerial statements would be introduced at the appropriate time and as soon as possible.
“But as governments of all political persuasions know, this isn’t always possible.”
She added: “The issue is not necessarily the time-frame in which the Data Retention and Investigatory Powers Act was introduced, but rather its content.
“This was emergency legislation, brought forward to clarify the legislative framework for certain important investigatory powers, to ensure UK law enforcement and intelligence agencies could maintain their ability to access telecommunications data.
“Let’s be clear, this is data the police need to investigate criminal activity and to protect the public.”
Liberal Democrat leader Willie Rennie hit back at the Justice Secretary, saying: “Sometimes I think this Government revels in being insulted by the UK Government.”
He suggested that as Mr MacAskill would have known the legislation was in the pipeline after a European Court of Justice decision in April, he should have communicated his concerns to Westminster.
“He doesn’t have to wait to be asked, surely he is a bit more forthcoming than that,” Mr Rennie said.